etc-update: fix default "enter" behavior
authorMike Frysinger <vapier@gentoo.org>
Sun, 11 Mar 2012 03:23:25 +0000 (22:23 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 11 Mar 2012 03:23:25 +0000 (22:23 -0500)
Adding support for -[3579] command line flags inadvertently broke the
default behavior of hitting "enter" to automatically select the next
file.  Make this work again.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
bin/etc-update

index cd63ae14be8cb2239b0adc21ae0b5bc10628bcee..7b05f113777fbfa6cd75b1789f6050a06ce0caf0 100755 (executable)
@@ -236,10 +236,13 @@ sel_file() {
                                        || die "$(<"${TMP}"/input)\n\nUser termination!" 0
                                input=$(<"${TMP}"/input)
                        fi
+                       : ${input:=0}
 
-                       parse_automode_flag ${input} || continue
+                       if [[ ${input} != 0 ]] ; then
+                               parse_automode_flag ${input} || continue
+                       fi
                fi # -3 automerge
-               if [[ ${input:-0} == 0 ]] ; then
+               if [[ ${input} == 0 ]] ; then
                        input=${isfirst}
                fi
        done