Skip to content

Commit b14c3bc

Browse files
committed
Added index check safety to remove unnecessary error
1 parent 2f40275 commit b14c3bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/docopt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public static function parse($optionDescription)
365365
foreach (preg_split('/\s+/', $options) as $s) {
366366
if (strpos($s, '--')===0)
367367
$long = $s;
368-
elseif ($s[0] == '-')
368+
elseif ($s && $s[0] == '-')
369369
$short = $s;
370370
else
371371
$argcount = 1;

0 commit comments

Comments
 (0)