Compare commits

..

No commits in common. "a741f3c473c30ca1fb398801a88259eaab807aea" and "b025e81c54d32cf82cf63572f7aa5532c8f48375" have entirely different histories.

1 changed files with 6 additions and 10 deletions

View File

@ -78,11 +78,11 @@ int nextnw(FILE* file) {
}
static
int _parse_key(FILE* file, char* out) {
void _parse_key(FILE* file, char* out) {
char c;
do {
c = fgetc(file);
if(c == ':' || c == ';') {
if(c == ':') {
*out = '\0';
} else if(c == '#') {
freadto(file, '\n');
@ -90,9 +90,7 @@ int _parse_key(FILE* file, char* out) {
*out = c;
++out;
}
} while(c != ':' && c != ';');
return c == ':';
} while(c != ':');
}
static
@ -139,11 +137,9 @@ void _parse_config(FILE* file) {
char begin = nextnw(file);
ungetc(begin, file);
int has_args = _parse_key(file, key);
_parse_key(file, key);
ungetc(nextnw(file), file);
if(has_args) {
_parse_value(file, value, &argc, argv);
}
struct type_handler_t* handler = _find_handler_for(key);
@ -181,7 +177,7 @@ int _validate_config(FILE* file) {
}
} while(c != ';');
return colon_count <= 1;
return colon_count == 1;
}
static