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