mirror of https://github.com/git/git.git
Merge branch 'rs/convert-fix-utf-without-dash'
The code to skip "UTF" and "UTF-" prefix, when computing an advice message, did not work correctly when the prefix was "UTF", which has been fixed. * rs/convert-fix-utf-without-dash: convert: fix handling of dashless UTF prefix in validate_encoding()
This commit is contained in:
commit
d17f54947d
|
@ -290,8 +290,8 @@ static int validate_encoding(const char *path, const char *enc,
|
||||||
const char *stripped = NULL;
|
const char *stripped = NULL;
|
||||||
char *upper = xstrdup_toupper(enc);
|
char *upper = xstrdup_toupper(enc);
|
||||||
upper[strlen(upper)-2] = '\0';
|
upper[strlen(upper)-2] = '\0';
|
||||||
if (!skip_prefix(upper, "UTF-", &stripped))
|
if (skip_prefix(upper, "UTF", &stripped))
|
||||||
skip_prefix(stripped, "UTF", &stripped);
|
skip_prefix(stripped, "-", &stripped);
|
||||||
advise(advise_msg, path, stripped);
|
advise(advise_msg, path, stripped);
|
||||||
free(upper);
|
free(upper);
|
||||||
if (die_on_error)
|
if (die_on_error)
|
||||||
|
@ -310,8 +310,8 @@ static int validate_encoding(const char *path, const char *enc,
|
||||||
"working-tree-encoding.");
|
"working-tree-encoding.");
|
||||||
const char *stripped = NULL;
|
const char *stripped = NULL;
|
||||||
char *upper = xstrdup_toupper(enc);
|
char *upper = xstrdup_toupper(enc);
|
||||||
if (!skip_prefix(upper, "UTF-", &stripped))
|
if (skip_prefix(upper, "UTF", &stripped))
|
||||||
skip_prefix(stripped, "UTF", &stripped);
|
skip_prefix(stripped, "-", &stripped);
|
||||||
advise(advise_msg, path, stripped, stripped);
|
advise(advise_msg, path, stripped, stripped);
|
||||||
free(upper);
|
free(upper);
|
||||||
if (die_on_error)
|
if (die_on_error)
|
||||||
|
|
Loading…
Reference in New Issue