aboutsummaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-01-07 13:27:13 -0800
committerJunio C Hamano <gitster@pobox.com>2015-01-07 13:27:13 -0800
commit64a03e970ab3ef0ce45d6bd3c1de1bff1de2beee (patch)
tree90144b1837dddc0cf0b805d3e23dc10b51018030 /utf8.c
parent83332636f575f00edff8f3afb15a2f96885bf417 (diff)
parent3d8a54eb37d298c251c0b6823dc06935a611bc33 (diff)
downloadgit-64a03e970ab3ef0ce45d6bd3c1de1bff1de2beee.tar.gz
git-64a03e970ab3ef0ce45d6bd3c1de1bff1de2beee.tar.xz
Merge branch 'maint-1.8.5' into maint-1.9
* maint-1.8.5: is_hfs_dotgit: loosen over-eager match of \u{..47}
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/utf8.c b/utf8.c
index 015c8157e..0cf56e3c7 100644
--- a/utf8.c
+++ b/utf8.c
@@ -629,8 +629,8 @@ int mbs_chrlen(const char **text, size_t *remainder_p, const char *encoding)
}
/*
- * Pick the next char from the stream, folding as an HFS+ filename comparison
- * would. Note that this is _not_ complete by any means. It's just enough
+ * Pick the next char from the stream, ignoring codepoints an HFS+ would.
+ * Note that this is _not_ complete by any means. It's just enough
* to make is_hfs_dotgit() work, and should not be used otherwise.
*/
static ucs_char_t next_hfs_char(const char **in)
@@ -667,12 +667,7 @@ static ucs_char_t next_hfs_char(const char **in)
continue;
}
- /*
- * there's a great deal of other case-folding that occurs,
- * but this is enough to catch anything that will convert
- * to ".git"
- */
- return tolower(out);
+ return out;
}
}
@@ -680,10 +675,23 @@ int is_hfs_dotgit(const char *path)
{
ucs_char_t c;
- if (next_hfs_char(&path) != '.' ||
- next_hfs_char(&path) != 'g' ||
- next_hfs_char(&path) != 'i' ||
- next_hfs_char(&path) != 't')
+ c = next_hfs_char(&path);
+ if (c != '.')
+ return 0;
+ c = next_hfs_char(&path);
+
+ /*
+ * there's a great deal of other case-folding that occurs
+ * in HFS+, but this is enough to catch anything that will
+ * convert to ".git"
+ */
+ if (c != 'g' && c != 'G')
+ return 0;
+ c = next_hfs_char(&path);
+ if (c != 'i' && c != 'I')
+ return 0;
+ c = next_hfs_char(&path);
+ if (c != 't' && c != 'T')
return 0;
c = next_hfs_char(&path);
if (c && !is_dir_sep(c))