summaryrefslogtreecommitdiffstats
path: root/gtk/src/quotestring.py
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/src/quotestring.py')
-rw-r--r--gtk/src/quotestring.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/gtk/src/quotestring.py b/gtk/src/quotestring.py
index 1c0c5b2d1..1038719e7 100644
--- a/gtk/src/quotestring.py
+++ b/gtk/src/quotestring.py
@@ -50,11 +50,10 @@ def main():
outfile = sys.stdout
ss = infile.read()
- ss = re.sub("\"", "\\\"", ss)
+ ss = re.sub(r'\\', r'\\\\', ss)
+ ss = re.sub(r'"', r'\\"', ss)
pattern = re.compile("$", re.M)
- # the replacement string below seems a bit strange, but it seems to be
- # the only way to get the litteral chars '\' 'n' inserted into the string
- ss = re.sub(pattern, "\\\\n\"", ss)
+ ss = re.sub(pattern, r'\\n"', ss)
pattern = re.compile("^", re.M)
ss = re.sub(pattern, "\"", ss)
outfile.write(ss)