xbps-remove: constify longopts; exec trans correctly.

This commit is contained in:
Juan RP 2012-11-05 09:51:34 +01:00
parent 0a7e917d49
commit caaf885229

View File

@ -243,7 +243,7 @@ int
main(int argc, char **argv) main(int argc, char **argv)
{ {
const char *shortopts = "C:c:dfhinOop:Rr:vVy"; const char *shortopts = "C:c:dfhinOop:Rr:vVy";
struct option longopts[] = { const struct option longopts[] = {
{ "config", required_argument, NULL, 'C' }, { "config", required_argument, NULL, 'C' },
{ "cachedir", required_argument, NULL, 'c' }, { "cachedir", required_argument, NULL, 'c' },
{ "debug", no_argument, NULL, 'd' }, { "debug", no_argument, NULL, 'd' },
@ -401,7 +401,7 @@ main(int argc, char **argv)
goto out; goto out;
} }
if (orphans || argc) if (orphans || (argc > optind))
rv = exec_transaction(&xh, maxcols, yes, drun); rv = exec_transaction(&xh, maxcols, yes, drun);
out: out: