Bugfix: stop if directory already exists
[gitweb.git] / config.c
index 9b7c6f2942483c7791277ad659b5683accafab8d..e89bab26c99f95e6bb7d3346343ab0c623843c42 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1,4 +1,3 @@
-#include <ctype.h>
 
 #include "cache.h"
 
@@ -14,6 +13,14 @@ static int get_next_char(void)
        c = '\n';
        if ((f = config_file) != NULL) {
                c = fgetc(f);
+               if (c == '\r') {
+                       /* DOS like systems */
+                       c = fgetc(f);
+                       if (c != '\n') {
+                               ungetc(c, f);
+                               c = '\r';
+                       }
+               }
                if (c == '\n')
                        config_linenr++;
                if (c == EOF) {