Replace equal/not equal uses of str[n]cmp() with rstreq[n] in binaries
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 31 Aug 2009 09:55:33 +0000 (12:55 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 31 Aug 2009 10:04:17 +0000 (13:04 +0300)
build.c
rpm2cpio.c
rpmqv.c

diff --git a/build.c b/build.c
index 193fe50..5c1f530 100644 (file)
--- a/build.c
+++ b/build.c
@@ -189,7 +189,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
     /* Create build tree if necessary */
     const char * buildtree = "%{_topdir}:%{_specdir}:%{_sourcedir}:%{_builddir}:%{_rpmdir}:%{_srcrpmdir}:%{_buildrootdir}";
     const char * rootdir = rpmtsRootDir(ts);
-    if (rpmMkdirs(strcmp(rootdir, "/") ? rootdir : NULL , buildtree)) {
+    if (rpmMkdirs(!rstreq(rootdir, "/") ? rootdir : NULL , buildtree)) {
        goto exit;
     }
 
index 1270ea8..92de0fa 100644 (file)
@@ -24,7 +24,7 @@ int main(int argc, char *argv[])
     if (argc == 1)
        fdi = fdDup(STDIN_FILENO);
     else {
-       if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
+       if (rstreq(argv[1], "-h") || rstreq(argv[1], "--help")) {
            fprintf(stderr, "Usage: rpm2cpio file.rpm\n");
            exit(EXIT_FAILURE);
        }
diff --git a/rpmqv.c b/rpmqv.c
index f14b80e..e226f42 100644 (file)
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -210,11 +210,11 @@ int main(int argc, char *argv[])
 
     /* Set the major mode based on argv[0] */
 #ifdef IAM_RPMBT
-    if (!strcmp(__progname, "rpmbuild"))       bigMode = MODE_BUILD;
+    if (rstreq(__progname, "rpmbuild"))        bigMode = MODE_BUILD;
 #endif
 #ifdef IAM_RPMQV
-    if (!strcmp(__progname, "rpmquery"))       bigMode = MODE_QUERY;
-    if (!strcmp(__progname, "rpmverify"))      bigMode = MODE_VERIFY;
+    if (rstreq(__progname, "rpmquery"))        bigMode = MODE_QUERY;
+    if (rstreq(__progname, "rpmverify")) bigMode = MODE_VERIFY;
 #endif
 
 #if defined(IAM_RPMQV)