index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2013-10-24 19:52:59 -0400 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-10-31 16:20:03 +1000 |
commit | 08191b13f2911b5f371824fbc224fe66c336bc76 (patch) | |
tree | 4bbd363852d6d1464b905c87fe19da62c804588d /src | |
parent | 1c5b94e6bbcf2e8e1c8bb2711465b98a894a9652 (diff) |
-rw-r--r-- | src/pacman/pacman.c | 12 |
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 3c9457a9..e5d16fc5 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -879,10 +879,8 @@ static int parseargs(int argc, char *argv[]) }; /* parse operation */ - while((opt = getopt_long(argc, argv, optstring, opts, &option_index))) { - if(opt < 0) { - break; - } else if(opt == 0) { + while((opt = getopt_long(argc, argv, optstring, opts, &option_index)) != -1) { + if(opt == 0) { continue; } else if(opt == '?') { /* unknown option, getopt printed an error */ @@ -906,10 +904,8 @@ static int parseargs(int argc, char *argv[]) /* parse all other options */ optind = 1; - while((opt = getopt_long(argc, argv, optstring, opts, &option_index))) { - if(opt < 0) { - break; - } else if(opt == 0) { + while((opt = getopt_long(argc, argv, optstring, opts, &option_index)) != -1) { + if(opt == 0) { continue; } else if(opt == '?') { /* this should have failed during first pass already */ |