From: Roland McGrath Date: Thu, 21 Apr 1994 20:16:42 +0000 (+0000) Subject: (chop_commands): Use find_char_unquote to find newlines. X-Git-Tag: 3.70.2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7eeab2fbe10ee6b23275d57295733f9add426976;p=thirdparty%2Fmake.git (chop_commands): Use find_char_unquote to find newlines. --- diff --git a/commands.c b/commands.c index d575b0c3..67e59b46 100644 --- a/commands.c +++ b/commands.c @@ -203,27 +203,14 @@ chop_commands (cmds) nlines = 5; lines = (char **) xmalloc (5 * sizeof (char *)); - idx = 0; - p = cmds->commands; + idx = strlen (cmds->commands) + 1; + p = (char *) alloca (idx); + bcopy (cmds->commands, p, idx); while (*p != '\0') { - char *end = p; - find_end:; - end = index (end, '\n'); + char *end = find_char_unquote (p, '\n', 0); 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) {