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>
This commit is contained in:
parent
5f24132d18
commit
b362c17daa
3
src/io.c
3
src/io.c
@ -806,9 +806,10 @@ io_extract_data (char *dst_data, const char *org, int len)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
for (; *org == ' ' || *org == '\t'; org++);
|
||||||
for (i = 0; i < len - 1; i++)
|
for (i = 0; i < len - 1; i++)
|
||||||
{
|
{
|
||||||
if (*org == '\n' || *org == '\0')
|
if (*org == '\n' || *org == '\0' || *org == '#')
|
||||||
break;
|
break;
|
||||||
*dst_data++ = *org++;
|
*dst_data++ = *org++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user