@@ -567,8 +567,8 @@ int mbs_chrlen(const char **text, size_t *remainder_p, const char *encoding)
567
567
}
568
568
569
569
/*
570
- * Pick the next char from the stream, folding as an HFS+ filename comparison
571
- * would. Note that this is _not_ complete by any means. It's just enough
570
+ * Pick the next char from the stream, ignoring codepoints an HFS+ would.
571
+ * Note that this is _not_ complete by any means. It's just enough
572
572
* to make is_hfs_dotgit() work, and should not be used otherwise.
573
573
*/
574
574
static ucs_char_t next_hfs_char (const char * * in )
@@ -605,23 +605,31 @@ static ucs_char_t next_hfs_char(const char **in)
605
605
continue ;
606
606
}
607
607
608
- /*
609
- * there's a great deal of other case-folding that occurs,
610
- * but this is enough to catch anything that will convert
611
- * to ".git"
612
- */
613
- return tolower (out );
608
+ return out ;
614
609
}
615
610
}
616
611
617
612
int is_hfs_dotgit (const char * path )
618
613
{
619
614
ucs_char_t c ;
620
615
621
- if (next_hfs_char (& path ) != '.' ||
622
- next_hfs_char (& path ) != 'g' ||
623
- next_hfs_char (& path ) != 'i' ||
624
- next_hfs_char (& path ) != 't' )
616
+ c = next_hfs_char (& path );
617
+ if (c != '.' )
618
+ return 0 ;
619
+ c = next_hfs_char (& path );
620
+
621
+ /*
622
+ * there's a great deal of other case-folding that occurs
623
+ * in HFS+, but this is enough to catch anything that will
624
+ * convert to ".git"
625
+ */
626
+ if (c != 'g' && c != 'G' )
627
+ return 0 ;
628
+ c = next_hfs_char (& path );
629
+ if (c != 'i' && c != 'I' )
630
+ return 0 ;
631
+ c = next_hfs_char (& path );
632
+ if (c != 't' && c != 'T' )
625
633
return 0 ;
626
634
c = next_hfs_char (& path );
627
635
if (c && !is_dir_sep (c ))
0 commit comments