Undo last change; reverted to revision 1.22.
authorRoland McGrath <roland@redhat.com>
Thu, 21 Apr 1994 22:14:01 +0000 (22:14 +0000)
committerRoland McGrath <roland@redhat.com>
Thu, 21 Apr 1994 22:14:01 +0000 (22:14 +0000)
commands.c

index 7544e51c9dd8f5ac9b8a031c6b47f9da346baee5..d575b0c3f0c6b822da5c6e38d3df18a040e253f0 100644 (file)
@@ -203,15 +203,27 @@ chop_commands (cmds)
 
       nlines = 5;
       lines = (char **) xmalloc (5 * sizeof (char *));
-      idx = strlen (cmds->commands) + 1;
-      p = (char *) alloca (idx);
-      bcopy (cmds->commands, p, idx);
       idx = 0;
+      p = cmds->commands;
       while (*p != '\0')
        {
-         char *end = find_char_unquote (p, '\n', 0);
+         char *end = p;
+       find_end:;
+         end = index (end, '\n');
          if (end == 0)
            end = p + strlen (p);
+         else if (end > p && end[-1] == '\\')
+           {
+             int backslash = 1;
+             register char *b;
+             for (b = end - 2; b >= p && *b == '\\'; --b)
+               backslash = !backslash;
+             if (backslash)
+               {
+                 ++end;
+                 goto find_end;
+               }
+           }
 
          if (idx == nlines)
            {