diff options
author | 2002-04-29 00:59:35 +0000 | |
---|---|---|
committer | 2002-04-29 00:59:35 +0000 | |
commit | 3000eb2b1d92527da1fdf0e2f71a08746969e0fb (patch) | |
tree | 5d8ff38d22452c3ae690751b8b7672d414412811 /lib/libc | |
parent | wierd -> weird in comment (diff) | |
download | wireguard-openbsd-3000eb2b1d92527da1fdf0e2f71a08746969e0fb.tar.xz wireguard-openbsd-3000eb2b1d92527da1fdf0e2f71a08746969e0fb.zip |
Rely on [] evaluating empty string as false, non-empty string as true
to eliminate a lot of -z and -n tests.
Thus,
'[ -z "$x" ] && cmd' -> '[ "$x" ] || cmd'
'if [ -z "$x" ]; then; y; fi' -> '[ "$x" ] || y'.
'[ -n "$x" ]' -> '[ "$x" ]'
Use variable default value syntax in a couple of places rather than if
statements. e.g. ': ${_ouranswer:=$_ifs}'.
Suggestions from millert@, aaron@, espie@, miod@ at various times.
Diffstat (limited to 'lib/libc')
0 files changed, 0 insertions, 0 deletions