Code

parse_option: check for '-' first and break if it is not an option
authorJonas Fonseca <fonseca@diku.dk>
Sun, 17 Sep 2006 22:57:30 +0000 (00:57 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Sun, 17 Sep 2006 22:57:30 +0000 (00:57 +0200)
tig.c

diff --git a/tig.c b/tig.c
index 7511353c8e3fb3ed70ac3194c29b2070015ad64c..18b4488eb825d56041156ded00a5e2df7199256e 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -451,6 +451,9 @@ parse_options(int argc, char *argv[])
        for (i = 1; i < argc; i++) {
                char *opt = argv[i];
 
+               if (opt[0] && opt[0] != '-')
+                       break;
+
                if (!strcmp(opt, "-l")) {
                        opt_request = REQ_VIEW_LOG;
                        continue;
@@ -494,9 +497,6 @@ parse_options(int argc, char *argv[])
                        break;
                }
 
-               if (opt[0] && opt[0] != '-')
-                       break;
-
                die("unknown option '%s'\n\n%s", opt, usage);
        }