summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-10-09 20:13:53 +0000
committerpfg <pfg@FreeBSD.org>2016-10-09 20:13:53 +0000
commit1b9aa0b299b3e53c74d22727603079f8155f0eac (patch)
treec40c50fc9d6a5d300951d83eb29d555e02a40014
parentd5f8c02ee1164a4580c530b7f3f20a8a07faf9f2 (diff)
downloadFreeBSD-src-1b9aa0b299b3e53c74d22727603079f8155f0eac.zip
FreeBSD-src-1b9aa0b299b3e53c74d22727603079f8155f0eac.tar.gz
MFC r306560, r306561:
patch(1): make some macros look boolean. Minor cleanup inspired by a new patch(1) variant in schily tools. For reference: https://sourceforge.net/p/schillix-on/
-rw-r--r--usr.bin/patch/common.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/patch/common.h b/usr.bin/patch/common.h
index f33abcf..6d416da 100644
--- a/usr.bin/patch/common.h
+++ b/usr.bin/patch/common.h
@@ -53,10 +53,9 @@
/* handy definitions */
-#define strNE(s1,s2) (strcmp(s1, s2))
-#define strEQ(s1,s2) (!strcmp(s1, s2))
-#define strnNE(s1,s2,l) (strncmp(s1, s2, l))
-#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l))
+#define strEQ(s1,s2) (strcmp(s1, s2) == 0)
+#define strnNE(s1,s2,l) (strncmp(s1, s2, l) != 0)
+#define strnEQ(s1,s2,l) (strncmp(s1, s2, l) == 0)
/* typedefs */
OpenPOWER on IntegriCloud