[PATCH 1/2] cli: fix notmuch top level argument parsing

Subject: [PATCH 1/2] cli: fix notmuch top level argument parsing

Date: Mon, 3 Dec 2012 22:56:12 +0200

To: notmuch@notmuchmail.org

Cc:

From: Jani Nikula


Use strcmp instead of STRNCMP_LITERAL, which matches the prefix
instead of the whole argument.
---
 notmuch.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/notmuch.c b/notmuch.c
index 477a09c..4ff66e3 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -245,10 +245,10 @@ main (int argc, char *argv[])
     if (argc == 1)
 	return notmuch (local);
 
-    if (STRNCMP_LITERAL (argv[1], "--help") == 0)
+    if (strcmp (argv[1], "--help") == 0)
 	return notmuch_help_command (NULL, argc - 1, &argv[1]);
 
-    if (STRNCMP_LITERAL (argv[1], "--version") == 0) {
+    if (strcmp (argv[1], "--version") == 0) {
 	printf ("notmuch " STRINGIFY(NOTMUCH_VERSION) "\n");
 	return 0;
     }
-- 
1.7.10.4


Thread: