Merge branch 'maint-1.9' into maint-2.0
authorJunio C Hamano <gitster@pobox.com>
Wed, 7 Jan 2015 21:27:19 +0000 (13:27 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Jan 2015 21:27:19 +0000 (13:27 -0800)
* maint-1.9:
is_hfs_dotgit: loosen over-eager match of \u{..47}

1  2 
utf8.c
diff --combined utf8.c
index a89704017a0997fd93ba14f198eb3e199d0f4274,0cf56e3c7e1ef9ad74b612da7b6a83479afd9b88..969f17ca5aaf98ac23f74d2a5ab9490570f73a09
--- 1/utf8.c
--- 2/utf8.c
+++ b/utf8.c
@@@ -5,8 -5,8 +5,8 @@@
  /* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */
  
  struct interval {
 -  int first;
 -  int last;
 +      ucs_char_t first;
 +      ucs_char_t last;
  };
  
  size_t display_mode_esc_sequence_len(const char *s)
@@@ -528,7 -528,7 +528,7 @@@ char *reencode_string_iconv(const char 
        while (1) {
                size_t cnt = iconv(conv, &cp, &insz, &outpos, &outsz);
  
 -              if (cnt == -1) {
 +              if (cnt == (size_t) -1) {
                        size_t sofar;
                        if (errno != E2BIG) {
                                free(out);
@@@ -629,8 -629,8 +629,8 @@@ int mbs_chrlen(const char **text, size_
  }
  
  /*
-  * Pick the next char from the stream, folding as an HFS+ filename comparison
-  * would. Note that this is _not_ complete by any means. It's just enough
+  * Pick the next char from the stream, ignoring codepoints an HFS+ would.
+  * Note that this is _not_ complete by any means. It's just enough
   * to make is_hfs_dotgit() work, and should not be used otherwise.
   */
  static ucs_char_t next_hfs_char(const char **in)
                        continue;
                }
  
-               /*
-                * there's a great deal of other case-folding that occurs,
-                * but this is enough to catch anything that will convert
-                * to ".git"
-                */
-               return tolower(out);
+               return out;
        }
  }
  
@@@ -680,10 -675,23 +675,23 @@@ int is_hfs_dotgit(const char *path
  {
        ucs_char_t c;
  
-       if (next_hfs_char(&path) != '.' ||
-           next_hfs_char(&path) != 'g' ||
-           next_hfs_char(&path) != 'i' ||
-           next_hfs_char(&path) != 't')
+       c = next_hfs_char(&path);
+       if (c != '.')
+               return 0;
+       c = next_hfs_char(&path);
+       /*
+        * there's a great deal of other case-folding that occurs
+        * in HFS+, but this is enough to catch anything that will
+        * convert to ".git"
+        */
+       if (c != 'g' && c != 'G')
+               return 0;
+       c = next_hfs_char(&path);
+       if (c != 'i' && c != 'I')
+               return 0;
+       c = next_hfs_char(&path);
+       if (c != 't' && c != 'T')
                return 0;
        c = next_hfs_char(&path);
        if (c && !is_dir_sep(c))