Fix for #159 (also slightly improved parsing for options, for portability between scripts also allow comment at the end of an option).
parent
ed4c1d88d0
commit
e4969b5af7
|
@ -317,17 +317,26 @@ void ParseLine(char *line, IOR_param_t * test, options_all_t * module_options)
|
|||
{
|
||||
char *start, *end;
|
||||
|
||||
start = line;
|
||||
char * newline = strdup(line);
|
||||
start = newline;
|
||||
do {
|
||||
end = strchr(start, '#');
|
||||
if (end != NULL)
|
||||
if (end != NULL){
|
||||
*end = '\0';
|
||||
end = NULL; // stop parsing after comment
|
||||
}
|
||||
end = strchr(start, ',');
|
||||
if (end != NULL)
|
||||
*end = '\0';
|
||||
if (end != NULL){
|
||||
*end = '\0';
|
||||
}
|
||||
if(strlen(start) < 3){
|
||||
fprintf(out_logfile, "Invalid option substring string: \"%s\" in \"%s\"\n", start, line);
|
||||
exit(1);
|
||||
}
|
||||
DecodeDirective(start, test, module_options);
|
||||
start = end + 1;
|
||||
} while (end != NULL);
|
||||
free(newline);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue