summaryrefslogtreecommitdiffstats
path: root/bin/sh/mksyntax.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-10-29 13:42:18 +0000
committerjilles <jilles@FreeBSD.org>2010-10-29 13:42:18 +0000
commit28ad180ab428c06679f4d2e8422bfb77ae2a926c (patch)
treea904801ee278e1d897c3118d8e675fd52f1a7856 /bin/sh/mksyntax.c
parentb6cd17990d125d91ed9a1a32e708c186c2fd3945 (diff)
downloadFreeBSD-src-28ad180ab428c06679f4d2e8422bfb77ae2a926c.zip
FreeBSD-src-28ad180ab428c06679f4d2e8422bfb77ae2a926c.tar.gz
sh: Do IFS splitting on word in ${v+word} and ${v-word}.
The code is inspired by NetBSD sh somewhat, but different because we preserve the old Almquist/Bourne/Korn ability to have an unquoted part in a quoted ${v+word}. For example, "${v-"*"}" expands to $v as a single field if v is set, but generates filenames otherwise. Note that this is the only place where we split text literally from the script (the similar ${v=word} assigns to v and then expands $v). The parser must now add additional markers to allow the expansion code to know whether arbitrary characters in substitutions are quoted. Example: for i in ${$+a b c}; do echo $i; done Exp-run done by: pav (with some other sh(1) changes)
Diffstat (limited to 'bin/sh/mksyntax.c')
-rw-r--r--bin/sh/mksyntax.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/sh/mksyntax.c b/bin/sh/mksyntax.c
index e4c4d14..07e8eb7 100644
--- a/bin/sh/mksyntax.c
+++ b/bin/sh/mksyntax.c
@@ -285,6 +285,7 @@ init(void)
syntax[base + CTLARI] = "CCTL";
syntax[base + CTLENDARI] = "CCTL";
syntax[base + CTLQUOTEMARK] = "CCTL";
+ syntax[base + CTLQUOTEEND] = "CCTL";
}
OpenPOWER on IntegriCloud