]> git.ipfire.org Git - thirdparty/git.git/blobdiff - config.c
config: do not ungetc EOF
[thirdparty/git.git] / config.c
index 2634457f6b07ca55b69f3b4a22b8a9e4339fd121..5eca17b24264573a04eebe8be3b397ec1e804954 100644 (file)
--- a/config.c
+++ b/config.c
@@ -228,7 +228,8 @@ static int get_next_char(void)
                /* DOS like systems */
                c = cf->do_fgetc(cf);
                if (c != '\n') {
-                       cf->do_ungetc(c, cf);
+                       if (c != EOF)
+                               cf->do_ungetc(c, cf);
                        c = '\r';
                }
        }
@@ -874,6 +875,16 @@ static int git_default_core_config(const char *var, const char *value)
                return 0;
        }
 
+       if (!strcmp(var, "core.protecthfs")) {
+               protect_hfs = git_config_bool(var, value);
+               return 0;
+       }
+
+       if (!strcmp(var, "core.protectntfs")) {
+               protect_ntfs = git_config_bool(var, value);
+               return 0;
+       }
+
        /* Add other config variables here and to Documentation/config.txt. */
        return 0;
 }