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