]> git.ipfire.org Git - thirdparty/bash.git/blobdiff - lib/sh/shquote.c
bash-4.3-beta overlay
[thirdparty/bash.git] / lib / sh / shquote.c
index c79ba9cdfadceafa091b3cc490b1567356ff84d5..31cce1c179c504d48d87fa3de7adda46529aa308 100644 (file)
@@ -94,6 +94,15 @@ sh_single_quote (string)
 
   result = (char *)xmalloc (3 + (4 * strlen (string)));
   r = result;
+
+  if (string[0] == '\'' && string[1] == 0)
+    {
+      *r++ = '\\';
+      *r++ = '\'';
+      *r++ = 0;
+      return result;
+    }
+
   *r++ = '\'';
 
   for (s = string; s && (c = *s); s++)