]> git.notmuchmail.org Git - notmuch/commitdiff
cli: fix notmuch top level argument parsing
authorJani Nikula <jani@nikula.org>
Mon, 3 Dec 2012 20:56:12 +0000 (22:56 +0200)
committerDavid Bremner <bremner@debian.org>
Tue, 4 Dec 2012 13:10:19 +0000 (09:10 -0400)
Use strcmp instead of STRNCMP_LITERAL, which matches the prefix
instead of the whole argument.

notmuch.c

index 477a09cf05dd1bd803e8d68bfadf0e3c82660a65..4ff66e3005dd3be43c532ff5d08a6a78e08fd655 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -245,10 +245,10 @@ main (int argc, char *argv[])
     if (argc == 1)
        return notmuch (local);
 
     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]);
 
        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;
     }
        printf ("notmuch " STRINGIFY(NOTMUCH_VERSION) "\n");
        return 0;
     }