summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre De Dommelin <adedommelin@tuxz.net>2017-03-12 15:49:46 -0700
committerLukas Schwaighofer <lukas@schwaighofer.name>2017-03-12 15:49:46 -0700
commit3243678674023aa87a8722afb9898cce148f2129 (patch)
tree693615726fb0ddb4d2818c7c079fc30562afb7dd
parent4500b7dce281e06f0fd9cefa753bfd4f0fce7d9d (diff)
escaping
# Description: Correct escaping of characters # Author: Luca Bedogni <me@lucabedogni.it> Gbp-Pq: Name 10-escaping.patch
-rw-r--r--src/gtkcompletionline.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gtkcompletionline.cc b/src/gtkcompletionline.cc
index 374deee..7aba856 100644
--- a/src/gtkcompletionline.cc
+++ b/src/gtkcompletionline.cc
@@ -226,12 +226,9 @@ string quote_string(const string& str)
const char* i = str.c_str();
while (*i) {
char c = *i++;
- switch (c) {
- case ' ':
- res += '\\';
- default:
- res += c;
- }
+ if (c == ' ' || c == '(' || c == ')' || c =='\'')
+ res += '\\';
+ res += c;
}
return res;
}