@@ -563,8 +563,8 @@ int mbs_chrlen(const char **text, size_t *remainder_p, const char *encoding)
563563}
564564
565565/*
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
568568 * to make is_hfs_dotgit() work, and should not be used otherwise.
569569 */
570570static ucs_char_t next_hfs_char (const char * * in )
@@ -601,23 +601,31 @@ static ucs_char_t next_hfs_char(const char **in)
601601 continue ;
602602 }
603603
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 ;
610605 }
611606}
612607
613608int is_hfs_dotgit (const char * path )
614609{
615610 ucs_char_t c ;
616611
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' )
621629 return 0 ;
622630 c = next_hfs_char (& path );
623631 if (c && !is_dir_sep (c ))
0 commit comments