summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-08-19 14:56:34 +0200
committerLars-Dominik Braun <lars@6xq.net>2011-08-19 14:56:34 +0200
commitdf557e9c75d23a66c99a6fdad07b384f7636cb9c (patch)
tree34989ebf8ef070be8de98edf397e789037968ccb
parent30956f51abd3d26e8ef085765af96cfddb5d1220 (diff)
downloadpianobar-df557e9c75d23a66c99a6fdad07b384f7636cb9c.tar.gz
pianobar-df557e9c75d23a66c99a6fdad07b384f7636cb9c.tar.bz2
pianobar-df557e9c75d23a66c99a6fdad07b384f7636cb9c.zip
Don’t remove whitespace from config values
Closes #148
-rw-r--r--src/settings.c5
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;
}