Fun fact about bash: the below is valid and will only ever print 'a'!

  fn() {
    continue 2
  }

  for x in {1..5}; do
    for y in {a..e}; do
      echo "$y"
      fn
    done
  done

Signed-off-by: Dave Reisner <[email protected]>
---
 scripts/library/parseopts.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/library/parseopts.sh b/scripts/library/parseopts.sh
index 11589ce..4bd0812 100644
--- a/scripts/library/parseopts.sh
+++ b/scripts/library/parseopts.sh
@@ -93,7 +93,6 @@ parseopts() {
                                                else
                                                        OPTRET+=("--$opt")
                                                        shift
-                                                       continue 2
                                                fi
                                                ;;
                                        1)
@@ -111,7 +110,7 @@ parseopts() {
                                                        OPTRET=(--)
                                                        return 1
                                                fi
-                                               continue 2
+                                               continue
                                                ;;
                                        254)
                                                # ambiguous option -- error was 
reported for us by longoptmatch()
-- 
1.8.0.3


Reply via email to