summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'job.c')
-rw-r--r--job.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/job.c b/job.c
index b3fef25..54e17c4 100644
--- a/job.c
+++ b/job.c
@@ -2845,8 +2845,11 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
char *p = new_line;
char *q = new_line;
memcpy (new_line, line, line_len + 1);
- /* replace all backslash-newline combination and also following tabs */
- while (*q != '\0')
+ /* Replace all backslash-newline combination and also following tabs.
+ Important: stop at the first '\n' because that's what the loop above
+ did. The next line starting at restp[0] will be executed during the
+ next call of this function. */
+ while (*q != '\0' && *q != '\n')
{
if (q[0] == '\\' && q[1] == '\n')
q += 2; /* remove '\\' and '\n' */