Code

Collect remaining string in last entry when parsing config file lines
authorJonas Fonseca <fonseca@diku.dk>
Sun, 7 Oct 2007 09:53:21 +0000 (11:53 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Sun, 7 Oct 2007 09:53:21 +0000 (11:53 +0200)
This raises the length of external commands to what fits in the command
buffer (1024 characters).

tig.c

diff --git a/tig.c b/tig.c
index 933d0835e360a557a7618f5fe638d74ae17056c4..c96faaed2119285b165c4be2b0efd61f8d709cd8 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -1219,9 +1219,10 @@ set_option(char *opt, char *value)
        /* Tokenize */
        while (argc < ARRAY_SIZE(argv) && (valuelen = strcspn(value, " \t"))) {
                argv[argc++] = value;
-
                value += valuelen;
-               if (!*value)
+
+               /* Nothing more to tokenize or last available token. */
+               if (!*value || argc >= ARRAY_SIZE(argv))
                        break;
 
                *value++ = 0;