Date: Sat, 3 Apr 2010 20:55:56 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/bin/sh parser.c src/tools/regression/bin/sh/expansion plus-minus2.0 src/tools/regression/bin/sh/parser heredoc2.0 Message-ID: <201004032058.o33KwYvl018663@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
jilles 2010-04-03 20:55:56 UTC
FreeBSD src repository
Modified files:
bin/sh parser.c
Added files:
tools/regression/bin/sh/expansion plus-minus2.0
tools/regression/bin/sh/parser heredoc2.0
Log:
SVN rev 206145 on 2010-04-03 20:55:56Z by jilles
sh: Fix various things about expansions:
* remove the backslash from \} inside double quotes inside +-=?
substitutions, e.g. "${$+\}a}"
* maintain separate double-quote state for ${v#...} and ${v%...};
single and double quotes are special inside, even in a double-quoted
string or here document
* keep track of correct order of substitutions and arithmetic
This is different from dash's approach, which does not track individual
double quotes in the parser, trying to fix this up during expansion.
This treats single quotes inside "${v#...}" incorrectly, however.
This is similar to NetBSD's approach (as submitted in PR bin/57554), but
recognizes the difference between +-=? and #% substitutions hinted at in
POSIX and is more refined for arithmetic expansion and here documents.
PR: bin/57554
Exp-run done by: erwin (with some other sh(1) changes)
Revision Changes Path
1.76 +208 -73 src/bin/sh/parser.c
1.1 +4 -0 src/tools/regression/bin/sh/expansion/plus-minus2.0 (new)
1.1 +44 -0 src/tools/regression/bin/sh/parser/heredoc2.0 (new)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004032058.o33KwYvl018663>
