diff options
| author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-26 09:31:16 +0200 | 
|---|---|---|
| committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-26 09:32:35 +0200 | 
| commit | 131bc80b967fb62c31e8f3badb5b15383df4ae0a (patch) | |
| tree | bf14d8ec0fc1ebba7486e7e0a9c2b1ee4da48d0e | |
| parent | a1094c801f95e1e9e617458fdb4294add2e29599 (diff) | |
msgfile: Allow to have comments in the simple CSV file
| -rw-r--r-- | src/msgfile.c | 4 | ||||
| -rw-r--r-- | tests/msgfile/msgconfig.cfg | 1 | 
2 files changed, 5 insertions, 0 deletions
| diff --git a/src/msgfile.c b/src/msgfile.c index 051f5b75..68f05813 100644 --- a/src/msgfile.c +++ b/src/msgfile.c @@ -70,6 +70,10 @@ static void handle_line(struct msg_entries *entries, char *line)  	char *items[3];  	int last_item = 0; +	/* Skip comments from the file */ +	if (line[0] == '#') +		return; +  	for (i = 0; i < len; ++i) {  		if (line[i] == '\n' || line[i] == '\r')  			line[i] = '\0'; diff --git a/tests/msgfile/msgconfig.cfg b/tests/msgfile/msgconfig.cfg index dfaad299..28d74326 100644 --- a/tests/msgfile/msgconfig.cfg +++ b/tests/msgfile/msgconfig.cfg @@ -1 +1,2 @@ +# This is a comment  *:*::Hello Welt | 
