Browse Source

config file parsing: allow blank lines

Sergey Lyubka 12 years ago
parent
commit
6f9901b65c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      main.c

+ 3 - 1
main.c

@@ -33,6 +33,7 @@
 #include <limits.h>
 #include <stddef.h>
 #include <stdarg.h>
+#include <ctype.h>
 
 #include "mongoose.h"
 
@@ -191,7 +192,8 @@ static void process_command_line_arguments(char *argv[], char **options) {
       line_no++;
 
       // Ignore empty lines and comments
-      if (line[0] == '#' || line[0] == '\n')
+	  for (i = 0; isspace(* (unsigned char *) &line[i]); ) i++;
+      if (line[i] == '#' || line[i] == '\0')
         continue;
 
       if (sscanf(line, "%s %[^\r\n#]", opt, val) != 2) {