@@ -171,16 +171,16 @@ __tar_parse_old_opt()
171171
172172 # current word is the first word
173173 [[ $cword -eq 1 && $cur && ${cur: 0: 1} != ' -' ]] &&
174- old_opt_progress=1
174+ old_opt_progress=true
175175
176176 # check that first argument does not begin with "-"
177177 first_word=${words[1]}
178178 [[ $first_word && ${first_word: 0: 1} != " -" ]] &&
179- old_opt_used=1
179+ old_opt_used=true
180180
181181 # parse the old option (if present) contents to allow later code expect
182182 # corresponding arguments
183- if (( old_opt_used == 1 )) ; then
183+ if " $ old_opt_used" ; then
184184 char=${first_word: 0: 1}
185185 while [[ $char ]]; do
186186 if __tar_is_argreq " $char " ; then
@@ -195,13 +195,12 @@ __tar_parse_old_opt()
195195# Make the analysis of whole command line.
196196__tar_preparse_cmdline ()
197197{
198- local first_arg i modes=" ctxurdA"
198+ local first_arg=true i modes=" ctxurdA"
199199
200200 shift # progname
201201
202202 __tar_parse_old_opt
203203
204- first_arg=1
205204 for i in " $@ " ; do
206205 case " $i " in
207206 --delete | --test-label)
@@ -220,14 +219,14 @@ __tar_preparse_cmdline()
220219 ;;
221220 * [$modes ]* )
222221 # Only the first arg may be "MODE" without leading dash
223- if (( first_arg == 1 )) ; then
222+ if " $ first_arg" ; then
224223 tar_mode=${i// [^$modes]/ }
225224 tar_mode=${tar_mode: 0: 1}
226225 tar_mode_arg=$i
227226 fi
228227 ;;
229228 esac
230- first_arg=0
229+ first_arg=false
231230 done
232231}
233232
@@ -306,7 +305,7 @@ __tar_complete_mode()
306305
307306 # The last short option requires argument, like '-cf<TAB>'. Cut the
308307 # completion here to enforce argument processing.
309- if (( old_opt_progress == 0 )) &&
308+ if ! " $old_opt_progress " &&
310309 __tar_is_argreq " $( __tar_last_char " $cur " ) " ; then
311310 COMPREPLY=(" $cur " ) && return 0
312311 fi
@@ -383,7 +382,7 @@ __tar_adjust_PREV_from_old_option()
383382 # deal with old style arguments here
384383 # $ tar cfTC # expects this sequence of arguments:
385384 # $ tar cfTC ARCHIVE_FILE PATTERNS_FILE CHANGE_DIR
386- if (( old_opt_used == 1 && cword > 1 && cword < ${# old_opt_parsed[@]} + 2 )) ; then
385+ if " $ old_opt_used" && (( cword > 1 && cword < ${# old_opt_parsed[@]} + 2 )) ; then
387386 # make e.g. 'C' option from 'cffCT'
388387 prev=" -${old_opt_parsed[cword - 2]} "
389388 fi
@@ -488,8 +487,8 @@ _gtar()
488487 local long_opts short_opts basic_tar=false \
489488 long_arg_none=" " long_arg_opt=" " long_arg_req=" " \
490489 short_arg_none=" " short_arg_opt=" " short_arg_req=" " \
491- tar_mode tar_mode_arg old_opt_progress=0 \
492- old_opt_used=0 old_opt_parsed=()
490+ tar_mode tar_mode_arg old_opt_progress=false \
491+ old_opt_used=false old_opt_parsed=()
493492
494493 # Main mode, e.g. -x or -c (extract/creation)
495494 local tar_mode=none
@@ -678,8 +677,8 @@ _posix_tar()
678677 local long_opts short_opts basic_tar=true \
679678 long_arg_none=" " long_arg_opt long_arg_req=" " \
680679 short_arg_none short_arg_opt short_arg_req \
681- tar_mode tar_mode_arg old_opt_progress=0 \
682- old_opt_used=1 old_opt_parsed=()
680+ tar_mode tar_mode_arg old_opt_progress=false \
681+ old_opt_used=true old_opt_parsed=()
683682
684683 # Main mode, e.g. -x or -c (extract/creation)
685684 local tar_mode=none
0 commit comments