mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Ignore trailing whitespace in settings .cfg files
Have settings_parseline() strip trailing whitespace from
the setting value.
Fixes a regression introduced by 5b1dd64f5
, which caused
filename settings to be parsed incorrectly when there is
trailing whitespace in the .cfg file.
Change-Id: I6c54428f6467ea2d169d2a7449705b40627e1a40
This commit is contained in:
parent
f3b522cac6
commit
90bc76956c
1 changed files with 9 additions and 0 deletions
|
@ -272,6 +272,15 @@ bool settings_parseline(char* line, char** name, char** value)
|
||||||
ptr++;
|
ptr++;
|
||||||
ptr = skip_whitespace(ptr);
|
ptr = skip_whitespace(ptr);
|
||||||
*value = ptr;
|
*value = ptr;
|
||||||
|
|
||||||
|
/* strip whitespace from the right side of value */
|
||||||
|
ptr += strlen(ptr);
|
||||||
|
for (ptr--; ptr >= *value; ptr--)
|
||||||
|
{
|
||||||
|
if (isspace(*ptr))
|
||||||
|
*ptr = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue