diff --git a/src/config.c b/src/config.c index 521e60b1..fc660ed5 100644 --- a/src/config.c +++ b/src/config.c @@ -68,7 +68,7 @@ void loadServerConfigFromString(char *config) { linenum = i+1; lines[i] = sdstrim(lines[i]," \t\r\n"); - /* Skip comments and blank lines*/ + /* Skip comments and blank lines */ if (lines[i][0] == '#' || lines[i][0] == '\0') continue; /* Split into arguments */ @@ -77,6 +77,12 @@ void loadServerConfigFromString(char *config) { err = "Unbalanced quotes in configuration line"; goto loaderr; } + + /* Skip this line if the resulting command vector is empty. */ + if (argc == 0) { + sdsfreesplitres(argv,argc); + return; + } sdstolower(argv[0]); /* Execute config directives */