From 8ecad23eae02bbdf36fe5dc8e53deb67fb894357 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Wed, 8 Oct 2014 15:42:08 +0800 Subject: [EXPAND] Do not split quoted VSLENGTH and VSTRIM Currently VSLENGTH and VSTRIM* are field-split even within quotes. This is obviously wrong. This patch fixes that. Signed-off-by: Herbert Xu --- ChangeLog | 1 + src/expand.c | 32 +++++++++++++------------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd2ee9d..e981a43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2014-10-08 Herbert Xu * Split unquoted $@/$* correctly when IFS is set but empty. + * Do not split quoted VSLENGTH and VSTRIM. 2014-10-07 Herbert Xu diff --git a/src/expand.c b/src/expand.c index 51ba8a1..dc8ae47 100644 --- a/src/expand.c +++ b/src/expand.c @@ -753,28 +753,22 @@ vsplus: argstr(p, flag | EXP_TILDE | EXP_WORD); goto end; } - if (easy) - goto record; - goto end; + goto record; } if (subtype == VSASSIGN || subtype == VSQUESTION) { - if (varlen < 0) { - if (subevalvar(p, var, 0, subtype, startloc, - varflags, flag & ~QUOTES_ESC)) { - varflags &= ~VSNUL; - /* - * Remove any recorded regions beyond - * start of variable - */ - removerecordregions(startloc); - goto again; - } - goto end; - } - if (easy) + if (varlen >= 0) goto record; - goto end; + + subevalvar(p, var, 0, subtype, startloc, varflags, + flag & ~QUOTES_ESC); + varflags &= ~VSNUL; + /* + * Remove any recorded regions beyond + * start of variable + */ + removerecordregions(startloc); + goto again; } if (varlen < 0 && uflag) @@ -786,9 +780,9 @@ vsplus: } if (subtype == VSNORMAL) { +record: if (!easy) goto end; -record: recordregion(startloc, expdest - (char *)stackblock(), nulonly); goto end; } -- cgit 1.4.1 ze='10' name='q' value=''/>
Commit message (Collapse)Author
2020-04-26Free part.parts.ptrJune McEnroe
Oops.
2020-04-26Rename part->id to part->contentIDJune McEnroe
Disambiguate with messageID.
2020-04-26Iterate through nested multiparts to find content for AtomJune McEnroe
Also fixes content for multipart/signed.
2020-04-26Include Cc address in reply mailtosJune McEnroe
2020-04-26Use %R for RFC numbers in STANDARDS sectionJune McEnroe
2020-04-26Add mailto spec to STANDARDSJune McEnroe
2020-04-26Increase space between nav itemsJune McEnroe
2020-04-26Add mailto address for the archiveJune McEnroe
2020-04-26Put dates on new lines in indexJune McEnroe
2020-04-26Include <> around Message-Id in mailto: URLsJune McEnroe
2020-04-26Add link to index on thread pagesJune McEnroe
2020-04-26Fall back to Content-Type name parameter for attachmentsJune McEnroe
2020-04-26Remove margins in article.message headerJune McEnroe
2020-04-26Generate index.atomJune McEnroe
2020-04-26Generate XHTML content in Atom entriesJune McEnroe
2020-04-25Style index pageJune McEnroe
2020-04-25Render index.htmlJune McEnroe
2020-04-25Wrap <summary> replies count in <data>June McEnroe
2020-04-25Accumulate thread envelopes before concatenationJune McEnroe
2020-04-24Free envelope in concatDataJune McEnroe
2020-04-24Use replyTo address in mailto:June McEnroe
2020-04-23Wrap quoted lines in <q>June McEnroe