mirror of
https://github.com/cesanta/mongoose.git
synced 2025-07-31 09:56:16 +08:00
config file parsing: allow blank lines
This commit is contained in:
parent
bce3a85702
commit
6f9901b65c
4
main.c
4
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user