X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=convert.c;h=25ac525d5fa5ea5ac68f8a7a998fe2359b515530;hb=70bf0b755af4d1e66da25b7805cac0e481a082e4;hp=deb6f71b2d164fc87dab3b741da34dde98c51374;hpb=773521df2689cc3ada76495c5b4061753b510d32;p=thirdparty%2Fgit.git diff --git a/convert.c b/convert.c index deb6f71b2d..25ac525d5f 100644 --- a/convert.c +++ b/convert.c @@ -290,8 +290,8 @@ static int validate_encoding(const char *path, const char *enc, const char *stripped = NULL; char *upper = xstrdup_toupper(enc); upper[strlen(upper)-2] = '\0'; - if (!skip_prefix(upper, "UTF-", &stripped)) - skip_prefix(stripped, "UTF", &stripped); + if (skip_prefix(upper, "UTF", &stripped)) + skip_prefix(stripped, "-", &stripped); advise(advise_msg, path, stripped); free(upper); if (die_on_error) @@ -310,8 +310,8 @@ static int validate_encoding(const char *path, const char *enc, "working-tree-encoding."); const char *stripped = NULL; char *upper = xstrdup_toupper(enc); - if (!skip_prefix(upper, "UTF-", &stripped)) - skip_prefix(stripped, "UTF", &stripped); + if (skip_prefix(upper, "UTF", &stripped)) + skip_prefix(stripped, "-", &stripped); advise(advise_msg, path, stripped, stripped); free(upper); if (die_on_error)