Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: basesrc/bin/sh



Module Name:    basesrc
Committed By:   christos
Date:           Fri Nov  2 23:49:15 UTC 2001

Modified Files:
        basesrc/bin/sh: parser.c

Log Message:
Fix switch alias handling. Inspired from FreeBSD, but corrected to handle
alias expansion inside the switch as appropriate. This is achieved by a
flag noalias which is turned on and off in as we parse. In the following
example [1] and [0] indicate the value of noalias.

[0] case <expr> in
[1] <lit> ) [0] <expr> ;;
[1] <lit> ) [0] <expr> ;;
...
[1] esac [0]

FreeBSD does:

[0] case <expr> in [1]
<lit> ) <expr> ;;
<lit> )  <expr> ;;
...
esac [0]

This handles the following shell script:

alias a=ls

case $1 in
a)      echo a;
        a;;
f)      echo f;;
*)      echo default;;
esac


To generate a diff of this commit:
cvs rdiff -r1.47 -r1.48 basesrc/bin/sh/parser.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index