summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-11-09 13:58:42 +0100
committerJim Meyering <meyering@redhat.com>2009-11-09 22:34:16 +0100
commit9353c6253d5fac1648b13ad9958468a2d9f6ad6f (patch)
tree083fa9f8de6150e9a4568e7e39455d8d6d99a412 /daemon
parent7cd4b6aeee3693463b03608a31cf53f21152c2e8 (diff)
downloadlibguestfs-9353c6253d5fac1648b13ad9958468a2d9f6ad6f.tar.gz
libguestfs-9353c6253d5fac1648b13ad9958468a2d9f6ad6f.tar.xz
libguestfs-9353c6253d5fac1648b13ad9958468a2d9f6ad6f.zip
convert uses of strcasecmp to STRCASEEQ
git grep -l 'strcasecmp *([^=]*== *0'| xargs \ perl -pi -e 's/\bstrcasecmp( *\(.*?\)) *== *0/STRCASEEQ$1/'
Diffstat (limited to 'daemon')
-rw-r--r--daemon/checksum.c14
-rw-r--r--daemon/debug.c2
-rw-r--r--daemon/realpath.c2
3 files changed, 9 insertions, 9 deletions
diff --git a/daemon/checksum.c b/daemon/checksum.c
index 24232650..499d19db 100644
--- a/daemon/checksum.c
+++ b/daemon/checksum.c
@@ -36,19 +36,19 @@ do_checksum (const char *csumtype, const char *path)
int r;
int len;
- if (strcasecmp (csumtype, "crc") == 0)
+ if (STRCASEEQ (csumtype, "crc"))
program = "cksum";
- else if (strcasecmp (csumtype, "md5") == 0)
+ else if (STRCASEEQ (csumtype, "md5"))
program = "md5sum";
- else if (strcasecmp (csumtype, "sha1") == 0)
+ else if (STRCASEEQ (csumtype, "sha1"))
program = "sha1sum";
- else if (strcasecmp (csumtype, "sha224") == 0)
+ else if (STRCASEEQ (csumtype, "sha224"))
program = "sha224sum";
- else if (strcasecmp (csumtype, "sha256") == 0)
+ else if (STRCASEEQ (csumtype, "sha256"))
program = "sha256sum";
- else if (strcasecmp (csumtype, "sha384") == 0)
+ else if (STRCASEEQ (csumtype, "sha384"))
program = "sha384sum";
- else if (strcasecmp (csumtype, "sha512") == 0)
+ else if (STRCASEEQ (csumtype, "sha512"))
program = "sha512sum";
else {
reply_with_error ("unknown checksum type, expecting crc|md5|sha1|sha224|sha256|sha384|sha512");
diff --git a/daemon/debug.c b/daemon/debug.c
index 8daa0324..04c52f00 100644
--- a/daemon/debug.c
+++ b/daemon/debug.c
@@ -80,7 +80,7 @@ do_debug (const char *subcmd MAYBE_UNUSED, char *const *argv MAYBE_UNUSED)
argc++;
for (i = 0; cmds[i].cmd != NULL; ++i) {
- if (strcasecmp (subcmd, cmds[i].cmd) == 0)
+ if (STRCASEEQ (subcmd, cmds[i].cmd))
return cmds[i].f (subcmd, argc, argv);
}
diff --git a/daemon/realpath.c b/daemon/realpath.c
index 0dc5fa5c..17e74ea7 100644
--- a/daemon/realpath.c
+++ b/daemon/realpath.c
@@ -113,7 +113,7 @@ do_case_sensitive_path (const char *path)
errno = 0;
while ((d = readdir (dir)) != NULL) {
- if (strcasecmp (d->d_name, name) == 0)
+ if (STRCASEEQ (d->d_name, name))
break;
}