From b43e701fc529bbc22f7669a3029c9aa8c5cf2dcb Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 13 Feb 2009 14:10:26 +0100 Subject: [PATCH] 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 --- NEWS | 1 + tig.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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; } } -- 2.32.0.93.g670b81a890