Message ID | 20180309150753.GC13375@gondor.apana.org.au (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Herbert Xu |
Headers | show |
On 3/9/18 4:07 PM, Herbert Xu wrote: > On Thu, Mar 08, 2018 at 07:35:53PM +0100, Harald van Dijk wrote: >> >> Related: >> >> x=*; cat <<EOF >> ${x#'*'} >> EOF >> >> This shouldn't print anything either: because the * is quoted, it should be >> taken as a literal and removed from $x. >> >> Re-testing, I see this didn't work properly with my patch either. > > I don't think this is related to our patches at all. Not related to our patches, but related to the original bug. It's another instance where quoted * is wrongly treated as unquoted. Your fix looks good to me. Cheers, Harald van Dijk -- To unsubscribe from this list: send the line "unsubscribe dash" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/src/parser.c b/src/parser.c index 3aeb9f6..d86d71e 100644 --- a/src/parser.c +++ b/src/parser.c @@ -940,7 +940,8 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) USTPUTC(c, out); break; case CCTL: - if (eofmark == NULL || synstack->dblquote) + if ((!eofmark) | synstack->dblquote | + synstack->varnest) USTPUTC(CTLESC, out); USTPUTC(c, out); break;