From caaf885229df13afc136124cfba9b7527a407e7e Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 5 Nov 2012 09:51:34 +0100 Subject: [PATCH] xbps-remove: constify longopts; exec trans correctly. --- bin/xbps-remove/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/xbps-remove/main.c b/bin/xbps-remove/main.c index 581eaa30..502a0c9f 100644 --- a/bin/xbps-remove/main.c +++ b/bin/xbps-remove/main.c @@ -243,7 +243,7 @@ int main(int argc, char **argv) { const char *shortopts = "C:c:dfhinOop:Rr:vVy"; - struct option longopts[] = { + const struct option longopts[] = { { "config", required_argument, NULL, 'C' }, { "cachedir", required_argument, NULL, 'c' }, { "debug", no_argument, NULL, 'd' }, @@ -401,7 +401,7 @@ main(int argc, char **argv) goto out; } - if (orphans || argc) + if (orphans || (argc > optind)) rv = exec_transaction(&xh, maxcols, yes, drun); out: