@@ -630,8 +630,8 @@ int mbs_chrlen(const char **text, size_t *remainder_p, const char *encoding)
630630}
631631
632632/*
633- * Pick the next char from the stream, folding as an HFS+ filename comparison
634- * would. Note that this is _not_ complete by any means. It's just enough
633+ * Pick the next char from the stream, ignoring codepoints an HFS+ would.
634+ * Note that this is _not_ complete by any means. It's just enough
635635 * to make is_hfs_dotgit() work, and should not be used otherwise.
636636 */
637637static ucs_char_t next_hfs_char (const char * * in )
@@ -668,23 +668,31 @@ static ucs_char_t next_hfs_char(const char **in)
668668 continue ;
669669 }
670670
671- /*
672- * there's a great deal of other case-folding that occurs,
673- * but this is enough to catch anything that will convert
674- * to ".git"
675- */
676- return tolower (out );
671+ return out ;
677672 }
678673}
679674
680675int is_hfs_dotgit (const char * path )
681676{
682677 ucs_char_t c ;
683678
684- if (next_hfs_char (& path ) != '.' ||
685- next_hfs_char (& path ) != 'g' ||
686- next_hfs_char (& path ) != 'i' ||
687- next_hfs_char (& path ) != 't' )
679+ c = next_hfs_char (& path );
680+ if (c != '.' )
681+ return 0 ;
682+ c = next_hfs_char (& path );
683+
684+ /*
685+ * there's a great deal of other case-folding that occurs
686+ * in HFS+, but this is enough to catch anything that will
687+ * convert to ".git"
688+ */
689+ if (c != 'g' && c != 'G' )
690+ return 0 ;
691+ c = next_hfs_char (& path );
692+ if (c != 'i' && c != 'I' )
693+ return 0 ;
694+ c = next_hfs_char (& path );
695+ if (c != 't' && c != 'T' )
688696 return 0 ;
689697 c = next_hfs_char (& path );
690698 if (c && !is_dir_sep (c ))
0 commit comments