From 716d9b9e7c2f11f4c5775756dc5845c09456fad4 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 21 Dec 2008 03:45:39 +0100 Subject: [PATCH] xbps-{bin,pkgdb}: use strcasecmp() to parse argv. --HG-- extra : convert_revision : deb4624c3f6d031925f3fcea0461d68d37703f89 --- utils/xbps-bin.c | 8 ++++---- utils/xbps-pkgdb.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/utils/xbps-bin.c b/utils/xbps-bin.c index c78979a5462..26697e98754 100644 --- a/utils/xbps-bin.c +++ b/utils/xbps-bin.c @@ -160,7 +160,7 @@ main(int argc, char **argv) if (argc < 2) usage(); - if (strcmp(argv[1], "repo-add") == 0) { + if (strcasecmp(argv[1], "repo-add") == 0) { /* Adds a new repository to the pool. */ if (argc != 3) usage(); @@ -205,7 +205,7 @@ main(int argc, char **argv) rinfo->total_pkgs); free(rinfo); - } else if (strcmp(argv[1], "repo-list") == 0) { + } else if (strcasecmp(argv[1], "repo-list") == 0) { /* Lists all repositories registered in pool. */ if (argc != 2) usage(); @@ -213,7 +213,7 @@ main(int argc, char **argv) xbps_callback_array_iter_in_dict(getrepolist_dict(), "repository-list", xbps_list_strings_in_array, NULL); - } else if (strcmp(argv[1], "repo-rm") == 0) { + } else if (strcasecmp(argv[1], "repo-rm") == 0) { /* Remove a repository from the pool. */ if (argc != 3) usage(); @@ -232,7 +232,7 @@ main(int argc, char **argv) exit(EINVAL); } - } else if (strcmp(argv[1], "show") == 0) { + } else if (strcasecmp(argv[1], "show") == 0) { /* Shows info about a binary package. */ if (argc != 3) usage(); diff --git a/utils/xbps-pkgdb.c b/utils/xbps-pkgdb.c index 9603b8ef486..9638fa2594d 100644 --- a/utils/xbps-pkgdb.c +++ b/utils/xbps-pkgdb.c @@ -192,7 +192,7 @@ main(int argc, char **argv) if (in_chroot_env != NULL) in_chroot = true; - if (strcmp(argv[1], "register") == 0) { + if (strcasecmp(argv[1], "register") == 0) { /* Registers a package into the database */ if (argc != 5) usage(); @@ -249,7 +249,7 @@ main(int argc, char **argv) printf("%s=> %s-%s registered successfully.\n", in_chroot ? "[chroot] " : "", argv[2], argv[3]); - } else if (strcmp(argv[1], "unregister") == 0) { + } else if (strcasecmp(argv[1], "unregister") == 0) { /* Unregisters a package from the database */ if (argc != 4) usage(); @@ -260,7 +260,7 @@ main(int argc, char **argv) printf("%s=> %s-%s unregistered successfully.\n", in_chroot ? "[chroot] " : "", argv[2], argv[3]); - } else if (strcmp(argv[1], "list") == 0) { + } else if (strcasecmp(argv[1], "list") == 0) { /* Lists packages currently registered in database */ if (argc != 2) usage(); @@ -270,7 +270,7 @@ main(int argc, char **argv) "packages", xbps_list_pkgs_in_dict, NULL)) exit(EINVAL); - } else if (strcmp(argv[1], "version") == 0) { + } else if (strcasecmp(argv[1], "version") == 0) { /* Prints version of an installed package */ if (argc != 3) usage(); @@ -284,7 +284,7 @@ main(int argc, char **argv) exit(1); printf("%s\n", version); - } else if (strcmp(argv[1], "sanitize-plist") == 0) { + } else if (strcasecmp(argv[1], "sanitize-plist") == 0) { /* Sanitize a plist file (indent the file properly) */ if (argc != 3) usage();