Skip to content

Commit

Permalink
Bashism crusade
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanhs committed Apr 5, 2013
1 parent 955fc91 commit 1726963
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions JSON.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ usage() {

parse_options() {
set -- "$@"
while true
local ARGN=$#
while [ $ARGN -ne 0 ]
do
case $1 in
-h) usage
Expand All @@ -42,6 +43,7 @@ parse_options() {
;;
esac
shift 1 || break
ARGN=$((ARGN-1))
done
}

Expand Down Expand Up @@ -129,10 +131,10 @@ parse_value () {
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
*) value=$token
isleaf=1
[ "$value" == '""' ] && isempty=1
[ "$value" = '""' ] && isempty=1
;;
esac
[ "$value" == '' ] && return
[ "$value" = '' ] && return
[ "$LEAFONLY" -eq 0 ] && [ "$PRUNE" -eq 0 ] && print=1
[ "$LEAFONLY" -eq 1 ] && [ "$isleaf" -eq 1 ] && [ $PRUNE -eq 0 ] && print=1
[ "$LEAFONLY" -eq 0 ] && [ "$PRUNE" -eq 1 ] && [ "$isempty" -eq 0 ] && print=1
Expand Down

0 comments on commit 1726963

Please sign in to comment.