]> thyrsus.com Git - src.git/commitdiff
Fix a bug in shell-edcaping comment arguments. Spotted by chungy.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 10 Nov 2014 16:13:39 +0000 (11:13 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 10 Nov 2014 16:13:39 +0000 (11:13 -0500)
src

diff --git a/src b/src
index 037ca74e2806f08f6de11b6b360cd9ed31060fcd..cafc073b172858cf51c416cb825425d87132e12e 100755 (executable)
--- a/src
+++ b/src
@@ -420,7 +420,7 @@ class CommentContext:
         if not self.comment.endswith("\n"):
             self.comment += "\n"
         # Because it's going to be handed back as a shell argument
-        self.comment = "'" + self.comment.replace("'", r"\'") + "'"
+        self.comment = "'" + self.comment.replace("'", r"'\''") + "'"
     def content(self):
         "Reurn the edited comment."
         return self.comment