@@ -276,7 +276,7 @@ __tar_complete_mode()
276276 filler i
277277
278278 short_modes=" ctx"
279- [[ ! $basic_tar ]] && short_modes=" ctxurdA"
279+ ! " $basic_tar " && short_modes=" ctxurdA"
280280
281281 # Remove prefix when needed
282282 rawopt=${cur# -}
@@ -289,7 +289,7 @@ __tar_complete_mode()
289289
290290 # when user passed something like 'tar cf' do not put the '-' before
291291 filler=
292- if [[ ! $cur && ! $basic_tar ]] ; then
292+ if [[ ! $cur ]] && ! " $basic_tar " ; then
293293 filler=-
294294 fi
295295
@@ -357,14 +357,14 @@ __tar_try_mode()
357357 case " $cur " in
358358 --* )
359359 # posix tar does not support long opts
360- [[ $basic_tar ]] && return 0
360+ " $basic_tar " && return 0
361361 __gtar_complete_lopts
362362 return $?
363363 ;;
364364
365365 -* )
366366 # posix tar does not support short options
367- [[ $basic_tar ]] && return 0
367+ " $basic_tar " && return 0
368368
369369 __tar_complete_mode && return 0
370370 ;;
@@ -485,7 +485,7 @@ __tar_detect_ext()
485485
486486_gtar ()
487487{
488- local long_opts short_opts basic_tar=" " \
488+ local long_opts short_opts basic_tar=false \
489489 long_arg_none=" " long_arg_opt=" " long_arg_req=" " \
490490 short_arg_none=" " short_arg_opt=" " short_arg_req=" " \
491491 tar_mode tar_mode_arg old_opt_progress=0 \
@@ -675,7 +675,7 @@ __tar_posix_prev_handle()
675675
676676_posix_tar ()
677677{
678- local long_opts short_opts basic_tar=" " \
678+ local long_opts short_opts basic_tar=true \
679679 long_arg_none=" " long_arg_opt long_arg_req=" " \
680680 short_arg_none short_arg_opt short_arg_req \
681681 tar_mode tar_mode_arg old_opt_progress=0 \
@@ -691,7 +691,6 @@ _posix_tar()
691691
692692 _comp_initialize -s -- " $@ " || return
693693
694- basic_tar=yes
695694 tar_mode=none
696695
697696 # relatively compatible modes are {c,t,x}
0 commit comments