diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2011-08-19 14:56:34 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2011-08-19 14:56:34 +0200 |
commit | df557e9c75d23a66c99a6fdad07b384f7636cb9c (patch) | |
tree | 34989ebf8ef070be8de98edf397e789037968ccb | |
parent | 30956f51abd3d26e8ef085765af96cfddb5d1220 (diff) | |
download | pianobar-df557e9c75d23a66c99a6fdad07b384f7636cb9c.tar.gz pianobar-df557e9c75d23a66c99a6fdad07b384f7636cb9c.tar.bz2 pianobar-df557e9c75d23a66c99a6fdad07b384f7636cb9c.zip |
Don’t remove whitespace from config values
Closes #148
-rw-r--r-- | src/settings.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/settings.c b/src/settings.c index 6b150d1..ea17985 100644 --- a/src/settings.c +++ b/src/settings.c @@ -153,10 +153,11 @@ void BarSettingsRead (BarSettings_t *settings) { /* read config file */ while (1) { - int scanRet = fscanf (configfd, "%255s = %255[^\n]", key, val); + char lwhite, rwhite; + int scanRet = fscanf (configfd, "%255s%c=%c%255[^\n]", key, &lwhite, &rwhite, val); if (scanRet == EOF) { break; - } else if (scanRet != 2) { + } else if (scanRet != 4 || lwhite != ' ' || rwhite != ' ') { /* invalid config line */ continue; } |