Code

Fix tokenizing when parsing ~/.tigrc
authorJonas Fonseca <fonseca@diku.dk>
Mon, 2 Feb 2009 08:08:46 +0000 (09:08 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Mon, 2 Feb 2009 08:14:09 +0000 (09:14 +0100)
When moving to use argv_from_string() in set_option() a regression was
introduced causing problems with parsing of multiple spaces between
arguments. For example:

color date              yellow  default

Reported by Clifford Caoile.

NEWS
tig.c

diff --git a/NEWS b/NEWS
index d8e1468ab2267ffe97cc9829137729d43466aebf..c8d080b05f703ff46185ec5323a2c576d07eebd5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Bug fixes:
 
  - Tree view: fix memory corruption bug when updating.
  - Fix regression for non-UTF-8 locales corrupting the view data.
+ - Fix regression parsing multiple spaces in ~/.tigrc.
 
 tig-0.13
 --------
diff --git a/tig.c b/tig.c
index 2a909b608b1893bc6c43c52175b4e26afdc71296..c569afc52fcfdebc1ffb7a2dbf8e54b9025957c7 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -292,7 +292,7 @@ argv_from_string(const char *argv[SIZEOF_ARG], int *argc, char *cmd)
 
                cmd[valuelen] = 0;
                argv[(*argc)++] = chomp_string(cmd);
-               cmd += valuelen + advance;
+               cmd = chomp_string(cmd + valuelen + advance);
        }
 
        if (*argc < SIZEOF_ARG)