Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: src/bin/sh
Module Name: src
Committed By: kre
Date: Sat Jun 3 10:31:16 UTC 2017
Modified Files:
src/bin/sh: expand.c expand.h memalloc.h parser.c
Log Message:
Fixes to shell expand (that is, $ stuff) from FreeBSD (implemented
differently...)
In particular ${01} is now $1 not $0 (for ${0any-digits})
${4294967297} is most probably now ""
(unless you have a very large number of params)
it is no longer an alias for $1 (4294967297 & 0xFFFFFFFF) == 1
$(( expr $(( more )) stuff )) is no longer the same as
$(( expr (( more )) stuff )) which was sometimes OK, as in:
$(( 3 + $(( 2 - 1 )) * 3 ))
but not always as in:
$(( 1$((1 + 1))1 ))
which should be 121, but was an arith syntax error as
1((1 + 1))1
is meaningless.
Probably some more. This also sprinkles a little const, splits a big
func that had 2 (kind of unrelated) purposes into two simpler ones,
and avoids some (semi-dubious) modifications (and restores) in the input
string to insert \0's when they were needed.
To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/bin/sh/expand.c
cvs rdiff -u -r1.21 -r1.22 src/bin/sh/expand.h
cvs rdiff -u -r1.15 -r1.16 src/bin/sh/memalloc.h
cvs rdiff -u -r1.130 -r1.131 src/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