@@ -630,8 +630,8 @@ int mbs_chrlen(const char **text, size_t *remainder_p, const char *encoding)
630
630
}
631
631
632
632
/*
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
635
635
* to make is_hfs_dotgit() work, and should not be used otherwise.
636
636
*/
637
637
static ucs_char_t next_hfs_char (const char * * in )
@@ -668,23 +668,31 @@ static ucs_char_t next_hfs_char(const char **in)
668
668
continue ;
669
669
}
670
670
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 ;
677
672
}
678
673
}
679
674
680
675
int is_hfs_dotgit (const char * path )
681
676
{
682
677
ucs_char_t c ;
683
678
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' )
688
696
return 0 ;
689
697
c = next_hfs_char (& path );
690
698
if (c && !is_dir_sep (c ))
0 commit comments