Merge branch 'bs/stdio-undef-before-redef'
[gitweb.git] / compat / precompose_utf8.c
index 7980abd1a71d0676f35eb300c46a30a7298e82f3..95fe849e42d3b9e1f7bc9590fcfac93016f38146 100644 (file)
@@ -48,11 +48,8 @@ void probe_utf8_pathname_composition(char *path, int len)
        if (output_fd >= 0) {
                close(output_fd);
                strcpy(path + len, auml_nfd);
-               /* Indicate to the user, that we can configure it to true */
-               if (!access(path, R_OK))
-                       git_config_set("core.precomposeunicode", "false");
-               /* To be backward compatible, set precomposed_unicode to 0 */
-               precomposed_unicode = 0;
+               precomposed_unicode = access(path, R_OK) ? 0 : 1;
+               git_config_set("core.precomposeunicode", precomposed_unicode ? "true" : "false");
                strcpy(path + len, auml_nfc);
                if (unlink(path))
                        die_errno(_("failed to unlink '%s'"), path);