mksh R50c: parser fixes break common “set -u” workaround

Bug #1378208 reported by Thorsten Glaser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mksh
Fix Released
Critical
Thorsten Glaser

Bug Description

tglase@tglase:~ $ MODULESDIR=/lib/modules/3.16-2-amd64
tglase@tglase:~ $ dir=kernel/drivers/scsi
tglase@tglase:~ $ exclude=
tglase@tglase:~ $ kmods=$(find "${MODULESDIR}/${dir}" ${exclude} -name '*.ko' -printf '%f\n')
tglase@tglase:~ $ kmods=$(find "${MODULESDIR}/${dir}" ${exclude:-} -name '*.ko' -printf '%f\n')
find: cannot search `': No such file or directory

${exclude:-} now generates a field where it previously didn’t.

Changed in mksh:
assignee: nobody → Thorsten Glaser (mirabilos)
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Thorsten Glaser (mirabilos) wrote :

Cause: https://github.com/MirBSD/mksh/commit/968dc7a764b1bd6a39411caaab54036513c264f0 eval.c changes (1.151 → 1.152)

Possibly this:

tglase@tglase:~ $ showargs() { for i; do echo -n " <$i>"; done; echo; }
tglase@tglase:~ $ IFS=:; showargs 1 ${-+:foo:bar}
 <1> <> <foo> <bar>
tglase@tglase:~ $ IFS=' '; showargs 1 ${-+ foo bar}
 <1> <> <foo> <bar>
tglase@tglase:~ $ ksh93
ksh93$ showargs() { for i; do echo -n " <$i>"; done; echo; }
ksh93$ IFS=:; showargs 1 ${-+:foo:bar}
 <1> <> <foo> <bar>
ksh93$ IFS=' '; showargs 1 ${-+ foo bar}
 <1> <foo> <bar>
ksh93$
tglase@tglase:~ $ bash
bash$ showargs() { for i; do echo -n " <$i>"; done; echo; }
bash$ IFS=:; showargs 1 ${-+:foo:bar}
 <1> <> <foo> <bar>
bash$ IFS=' '; showargs 1 ${-+ foo bar}
 <1> <foo> <bar>

Only IFS_NWS should generate a field.

Changed in mksh:
status: Confirmed → Fix Committed
Revision history for this message
Thorsten Glaser (mirabilos) wrote :

fixed in R50d

Changed in mksh:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.