diff options
author | kate.ward <kate.ward@forestent.com> | 2013-01-15 00:13:10 +0000 |
---|---|---|
committer | kate.ward <kate.ward@forestent.com> | 2013-01-15 00:13:10 +0000 |
commit | d87a1d9dd5c5b5152c61ca49ce1aea01aace10e9 (patch) | |
tree | 3a0cf2ba4a0ea88b285cfa9d68852838f7cd45ed /source/1.0/src | |
parent | 691f3d1ecb5f8d4b89848cd16fdfb6126e227984 (diff) | |
download | shflags-d87a1d9dd5c5b5152c61ca49ce1aea01aace10e9.tar.gz |
fixed math bug on FreeBSD-9.1; retested
Diffstat (limited to 'source/1.0/src')
-rw-r--r-- | source/1.0/src/shflags | 2 | ||||
-rwxr-xr-x | source/1.0/src/shflags_test_private.sh | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source/1.0/src/shflags b/source/1.0/src/shflags index b77a6ab..726b206 100644 --- a/source/1.0/src/shflags +++ b/source/1.0/src/shflags @@ -709,7 +709,7 @@ _flags_parseGetopt() # properly give user access to non-flag arguments mixed in between flag # arguments. Its usage was replaced by FLAGS_ARGV, and it is being kept only # for backwards compatibility reasons. - FLAGS_ARGC=`_flags_math $# - 1 - ${_flags_argc_}` + FLAGS_ARGC=`_flags_math "$# - 1 - ${_flags_argc_}"` # handle options. note options with values must do an additional shift while true; do diff --git a/source/1.0/src/shflags_test_private.sh b/source/1.0/src/shflags_test_private.sh index 899f5df..d5c6112 100755 --- a/source/1.0/src/shflags_test_private.sh +++ b/source/1.0/src/shflags_test_private.sh @@ -168,15 +168,15 @@ testValidIntExpr() _testMath() { - result=`_flags_math 1 + 1` - assertTrue '1+1 failed' $? - assertEquals '1+1' 2 ${result} + result=`_flags_math 1` + assertTrue '1 failed' $? + assertEquals '1' 1 ${result} result=`_flags_math '1 + 2'` assertTrue '1+2 failed' $? assertEquals '1+2' 3 ${result} - result=`_flags_math 1 + 2 + 3` + result=`_flags_math '1 + 2 + 3'` assertTrue '1+2+3 failed' $? assertEquals '1+2+3' 6 ${result} |