Source-Changes archive

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

CVS commit: src/bin/sh




To: source-changes%NetBSD.org@localhost

Subject: CVS commit: src/bin/sh

From: "Robert Elz" <kre%netbsd.org@localhost>

Date: Sat, 21 Apr 2018 23:01:29 +0000


Module Name:    src
Committed By:   kre
Date:           Sat Apr 21 23:01:29 UTC 2018

Modified Files:
        src/bin/sh: arithmetic.c

Log Message:
In uses like $(( var )) (un-dollared vars in arithmetic) we allow
leading whitespace in the value of var (because strtoimax() does)
but did not allow trailing whitespace.   The effect is that some
cases where $(( ${var:-0} )) would work do not work without the $
expansion.

Fix that - allow trailing whitespace.   However, continue to insist
upon at least one digit (a non-null var that contains nothing but
whitespace is still an error).

Note: posix is not helpful here, it simply requires that the variable
contain "a value that forms a valid integer constant" (with an optional
+ or - sign).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/bin/sh/arithmetic.c

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






Prev by Date: CVS commit: src/bin/sh

Next by Date: CVS commit: src/sys/arch/amd64/amd64

Previous by Thread: CVS commit: src/bin/sh

Next by Thread: CVS commit: src/sys/arch/amd64/amd64

Indexes:

reverse Date

reverse Thread

Old Index



Home | Main Index | Thread Index | Old Index