diff options
-rw-r--r-- | opentracker.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/opentracker.c b/opentracker.c index 579e41e..bb024b0 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -374,8 +374,8 @@ int parse_configfile( char * config_filename ) { | |||
374 | } | 374 | } |
375 | 375 | ||
376 | while( fgets( inbuf, sizeof(inbuf), accesslist_filehandle ) ) { | 376 | while( fgets( inbuf, sizeof(inbuf), accesslist_filehandle ) ) { |
377 | char *newl; | ||
378 | char *p = inbuf; | 377 | char *p = inbuf; |
378 | size_t strl; | ||
379 | 379 | ||
380 | /* Skip white spaces */ | 380 | /* Skip white spaces */ |
381 | while(isspace(*p)) ++p; | 381 | while(isspace(*p)) ++p; |
@@ -383,8 +383,10 @@ int parse_configfile( char * config_filename ) { | |||
383 | /* Ignore comments and empty lines */ | 383 | /* Ignore comments and empty lines */ |
384 | if((*p=='#')||(*p=='\n')||(*p==0)) continue; | 384 | if((*p=='#')||(*p=='\n')||(*p==0)) continue; |
385 | 385 | ||
386 | /* chomp */ | 386 | /* consume trailing new lines and spaces */ |
387 | if(( newl = strchr(p, '\n' ))) *newl = 0; | 387 | strl = strlen(p); |
388 | while( strl && isspace(p[strl-1])) | ||
389 | p[--strl] = 0; | ||
388 | 390 | ||
389 | /* Scan for commands */ | 391 | /* Scan for commands */ |
390 | if(!byte_diff(p,15,"tracker.rootdir" ) && isspace(p[15])) { | 392 | if(!byte_diff(p,15,"tracker.rootdir" ) && isspace(p[15])) { |