]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(append_quoted): Quote ' correctly.
authorJim Meyering <jim@meyering.net>
Wed, 19 Oct 2005 07:32:14 +0000 (07:32 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 19 Oct 2005 07:32:14 +0000 (07:32 +0000)
Problem reported by Eric Blake.

src/dircolors.c

index 19bdd3335e65cdee69d79e84e30d7ba6cacacb23..ace0d78a55fb77ee7325ed2447037ae376e9cbc4 100644 (file)
@@ -207,6 +207,13 @@ append_quoted (const char *str)
     {
       switch (*str)
        {
+       case '\'':
+         APPEND_CHAR ('\'');
+         APPEND_CHAR ('\\');
+         APPEND_CHAR ('\'');
+         need_backslash = true;
+         break;
+
        case '\\':
        case '^':
          need_backslash = !need_backslash;