diff options
author | Roland McGrath <roland@redhat.com> | 1994-04-21 20:16:42 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 1994-04-21 20:16:42 +0000 |
commit | 7eeab2fbe10ee6b23275d57295733f9add426976 (patch) | |
tree | 627e1564fb9e98ceb0a10ed72a9af2f26874a6ec /commands.c | |
parent | f6716d5e74d06e2c24ee1b2935fe17c576d39b4c (diff) | |
download | gunmake-7eeab2fbe10ee6b23275d57295733f9add426976.tar.gz |
(chop_commands): Use find_char_unquote to find newlines.
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 21 |
1 files changed, 4 insertions, 17 deletions
@@ -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) { |