summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1994-04-21 22:14:01 +0000
committerRoland McGrath <roland@redhat.com>1994-04-21 22:14:01 +0000
commitac336f7a9c2bfa7dbfcbb358b44d2b867395370b (patch)
tree968a4a4851cb652790d50aa99ba9b83c706c3b86
parent8f581d3bc0322f0227bbe0bc992dbd8c8f1b6376 (diff)
downloadgunmake-ac336f7a9c2bfa7dbfcbb358b44d2b867395370b.tar.gz
Undo last change; reverted to revision 1.22.
-rw-r--r--commands.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/commands.c b/commands.c
index 7544e51..d575b0c 100644
--- a/commands.c
+++ b/commands.c
@@ -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)
{