File: 10-escaping.patch

package info (click to toggle)
gmrun 0.9.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 736 kB
  • ctags: 682
  • sloc: cpp: 1,922; sh: 439; makefile: 39; ansic: 9
file content (21 lines) | stat: -rw-r--r-- 445 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Description: Correct escaping of characters
Author: Luca Bedogni <me@lucabedogni.it>

--- a/src/gtkcompletionline.cc
+++ b/src/gtkcompletionline.cc
@@ -226,12 +226,9 @@
   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;
 }