diff options
Diffstat (limited to 'apps/misc.c')
-rw-r--r-- | apps/misc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/misc.c b/apps/misc.c index 1410d47244..6e871acd3b 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -605,8 +605,7 @@ bool settings_parseline(char* line, char** name, char** value) | |||
605 | { | 605 | { |
606 | char* ptr; | 606 | char* ptr; |
607 | 607 | ||
608 | while ( isspace(*line) ) | 608 | line = skip_whitespace(line); |
609 | line++; | ||
610 | 609 | ||
611 | if ( *line == '#' ) | 610 | if ( *line == '#' ) |
612 | return false; | 611 | return false; |
@@ -618,8 +617,7 @@ bool settings_parseline(char* line, char** name, char** value) | |||
618 | *name = line; | 617 | *name = line; |
619 | *ptr = 0; | 618 | *ptr = 0; |
620 | ptr++; | 619 | ptr++; |
621 | while (isspace(*ptr)) | 620 | ptr = skip_whitespace(ptr); |
622 | ptr++; | ||
623 | *value = ptr; | 621 | *value = ptr; |
624 | return true; | 622 | return true; |
625 | } | 623 | } |
@@ -1123,6 +1121,16 @@ char* strrsplt(char* str, int c) | |||
1123 | return s; | 1121 | return s; |
1124 | } | 1122 | } |
1125 | 1123 | ||
1124 | char* skip_whitespace(char* const str) | ||
1125 | { | ||
1126 | char *s = str; | ||
1127 | |||
1128 | while (isspace(*s)) | ||
1129 | s++; | ||
1130 | |||
1131 | return s; | ||
1132 | } | ||
1133 | |||
1126 | /* Test file existence, using dircache of possible */ | 1134 | /* Test file existence, using dircache of possible */ |
1127 | bool file_exists(const char *file) | 1135 | bool file_exists(const char *file) |
1128 | { | 1136 | { |