summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-07-15 18:08:58 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2011-07-15 18:13:45 +0200
commitb362c17daa3cf44f6b62648e1b0fe0175c7a01e6 (patch)
tree5afe7feb04611b3955d8b3f31219d8e51f8f9908 /src
parent5f24132d18895e6b4670798e63812d6611b25459 (diff)
downloadcalcurse-b362c17daa3cf44f6b62648e1b0fe0175c7a01e6.tar.gz
calcurse-b362c17daa3cf44f6b62648e1b0fe0175c7a01e6.zip
Skip indentation and comments in io_extract_data()
We actually only use this function to parse configuration data. Currently, this probably is the best way to do some common preprocessing. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src')
-rw-r--r--src/io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/io.c b/src/io.c
index 860d7ee..234fc14 100644
--- a/src/io.c
+++ b/src/io.c
@@ -806,9 +806,10 @@ io_extract_data (char *dst_data, const char *org, int len)
{
int i;
+ for (; *org == ' ' || *org == '\t'; org++);
for (i = 0; i < len - 1; i++)
{
- if (*org == '\n' || *org == '\0')
+ if (*org == '\n' || *org == '\0' || *org == '#')
break;
*dst_data++ = *org++;
}