git-svn: trunk@1848
Tomasz Kojm authored on 2006/03/08 04:00:43... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Tue Mar 7 19:56:58 CET 2006 (tk) |
|
2 |
+--------------------------------- |
|
3 |
+ * shared/cfgparser.c: strip newlines from FULLSTR args |
|
4 |
+ |
|
1 | 5 |
Tue Mar 7 11:04:37 CET 2006 (tk) |
2 | 6 |
--------------------------------- |
3 | 7 |
* libclamav/zziplib: fix compiler warnings (patch by Stephen Gran) |
... | ... |
@@ -36,7 +36,7 @@ static int regcfg(struct cfgstruct **copt, char *optname, char *strarg, int numa |
36 | 36 |
|
37 | 37 |
struct cfgstruct *getcfg(const char *cfgfile, int verbose) |
38 | 38 |
{ |
39 |
- char buff[LINE_LENGTH], *name, *arg; |
|
39 |
+ char buff[LINE_LENGTH], *name, *arg, *c; |
|
40 | 40 |
FILE *fs; |
41 | 41 |
int line = 0, i, found, ctype, calc, val; |
42 | 42 |
struct cfgstruct *copt = NULL; |
... | ... |
@@ -188,6 +188,8 @@ struct cfgstruct *getcfg(const char *cfgfile, int verbose) |
188 | 188 |
free(arg); |
189 | 189 |
arg = strstr(buff, " "); |
190 | 190 |
arg = strdup(++arg); |
191 |
+ if((c = strpbrk(arg, "\n\r"))) |
|
192 |
+ *c = '\0'; |
|
191 | 193 |
if(regcfg(&copt, name, arg, -1, pt->multiple) < 0) { |
192 | 194 |
fprintf(stderr, "ERROR: Can't register new options (not enough memory)\n"); |
193 | 195 |
fclose(fs); |