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