Skip to content

Commit

Permalink
flag: simplify arg logic in parseOne
Browse files Browse the repository at this point in the history
Fixes #21763.

Change-Id: I59ee4f24c8064df64d9ede11aac02bc7ce4995b3
Reviewed-on: https://go-review.googlesource.com/61491
Reviewed-by: Daniel Martí <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
Run-TryBot: Daniel Martí <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
alexpantyukhin authored and bradfitz committed Sep 5, 2017
1 parent 6675fad commit 2d362f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flag/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ func (f *FlagSet) parseOne() (bool, error) {
return false, nil
}
s := f.args[0]
if len(s) == 0 || s[0] != '-' || len(s) == 1 {
if len(s) < 2 || s[0] != '-' {
return false, nil
}
numMinuses := 1
Expand Down

0 comments on commit 2d362f7

Please sign in to comment.