Skip to content
This repository
Browse code

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 <sh@tokkee.org>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
  • Loading branch information...
commit b43e701fc529bbc22f7669a3029c9aa8c5cf2dcb 1 parent 7b507b4
Sebastian Harl tokkee authored committed

Showing 2 changed files with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 0  NEWS
  2. +1 1  tig.c
1  NEWS
@@ -19,6 +19,7 @@ Bug fixes:
19 19 - Blame view: fix problem with uninitialized variable.
20 20 - Blame view: use line number information when loading blame for
21 21 specific commit.
  22 + - Fix handling of quoted strings in the config file.
22 23
23 24 tig-0.14
24 25 --------
2  tig.c
@@ -1470,7 +1470,7 @@ parse_string(char *opt, const char *arg, size_t optsize)
1470 1470 }
1471 1471 arg += 1; arglen -= 2;
1472 1472 default:
1473   - string_ncopy_do(opt, optsize, arg, strlen(arg));
  1473 + string_ncopy_do(opt, optsize, arg, arglen);
1474 1474 return OK;
1475 1475 }
1476 1476 }

0 comments on commit b43e701

Please sign in to comment.
Something went wrong with that request. Please try again.