@@ -567,8 +567,8 @@ int mbs_chrlen(const char **text, size_t *remainder_p, const char *encoding)
567567}
568568
569569/*
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
572572 * to make is_hfs_dotgit() work, and should not be used otherwise.
573573 */
574574static ucs_char_t next_hfs_char (const char * * in )
@@ -605,23 +605,31 @@ static ucs_char_t next_hfs_char(const char **in)
605605 continue ;
606606 }
607607
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 ;
614609 }
615610}
616611
617612int is_hfs_dotgit (const char * path )
618613{
619614 ucs_char_t c ;
620615
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' )
625633 return 0 ;
626634 c = next_hfs_char (& path );
627635 if (c && !is_dir_sep (c ))
0 commit comments