]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Bugfix: it choked on an empty argument!
authorGuido van Rossum <guido@python.org>
Thu, 9 Jan 1992 11:37:07 +0000 (11:37 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 9 Jan 1992 11:37:07 +0000 (11:37 +0000)
Lib/getopt.py

index 0b71d0f3a7af22126ff38710a2de21e793d9d970..7feaf9d525201ad07320dd65697d4a60b661a87b 100644 (file)
@@ -22,7 +22,7 @@ error = 'getopt error'
 
 def getopt(args, options):
     list = []
-    while args and args[0][0] == '-' and args[0] <> '-':
+    while args and args[0][:1] == '-' and args[0] <> '-':
        if args[0] == '--':
            args = args[1:]
            break