From: Sebastian Harl Date: Fri, 13 Feb 2009 13:10:26 +0000 (+0100) Subject: Fix handling of quoted strings in the config file X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b43e701fc529bbc22f7669a3029c9aa8c5cf2dcb;p=tig.git Fix handling of quoted strings in the config file parse_string() adapts the string length to automatically remove quotation marks when copying the string. However, when calling string_ncopy_do() strlen(arg) used to be called again instead of using the adapted value. This e.g. led to wrong locale settings when using set commit-encoding = "UTF-8" and thus a slightly messed up display. Thanks to Gerfried Fuchs for reporting this. Signed-off-by: Sebastian Harl Signed-off-by: Jonas Fonseca --- diff --git a/NEWS b/NEWS index 7927c21..e52130c 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ Bug fixes: - Blame view: fix problem with uninitialized variable. - Blame view: use line number information when loading blame for specific commit. + - Fix handling of quoted strings in the config file. tig-0.14 -------- diff --git a/tig.c b/tig.c index 7072094..2b2607b 100644 --- a/tig.c +++ b/tig.c @@ -1470,7 +1470,7 @@ parse_string(char *opt, const char *arg, size_t optsize) } arg += 1; arglen -= 2; default: - string_ncopy_do(opt, optsize, arg, strlen(arg)); + string_ncopy_do(opt, optsize, arg, arglen); return OK; } }