From bf60bbd67a345c27fae513372dd05a8c019176f6 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 26 May 2013 13:56:51 -0400 Subject: [SV #39035] Compare OUT to the beginning of the OUT var/func, not IN. --- job.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'job.c') diff --git a/job.c b/job.c index 5f665a9..507b90d 100644 --- a/job.c +++ b/job.c @@ -2036,10 +2036,12 @@ new_job (struct file *file) { char openparen = *ref; char closeparen = openparen == '(' ? ')' : '}'; + char *outref; int count; char *p; *out++ = *in++; /* Copy OPENPAREN. */ + outref = out; /* IN now points past the opening paren or brace. Count parens or braces until it is matched. */ count = 0; @@ -2072,7 +2074,7 @@ new_job (struct file *file) /* Discard any preceding whitespace that has already been written to the output. */ - while (out > ref + while (out > outref && isblank ((unsigned char)out[-1])) --out; -- cgit v1.2.3