diff --git a/src/conf.c b/src/conf.c index 8dadc780..2e1776fa 100644 --- a/src/conf.c +++ b/src/conf.c @@ -51,7 +51,7 @@ static LL_HANDLE conf_main=NULL; static char *conf_main_file = NULL; static pthread_mutex_t conf_mutex = PTHREAD_MUTEX_INITIALIZER; -#define conf_LINEBUFFER 128 +#define CONF_LINEBUFFER 128 #define CONF_T_INT 0 #define CONF_T_STRING 1 @@ -229,12 +229,14 @@ int _conf_verify(LL_HANDLE pll) { int conf_read(char *file) { FILE *fin; int err; - LL_HANDLE pllnew, plltemp, pllcurrent; - char linebuffer[conf_LINEBUFFER+1]; + LL_HANDLE pllnew, plltemp, pllcurrent, pllcomment; + char linebuffer[CONF_LINEBUFFER+1]; char *comment, *term, *value, *delim; + char *running_comment=NULL; int compat_mode=1; int line=0; + if(conf_main_file) { conf_close(); } @@ -252,19 +254,21 @@ int conf_read(char *file) { return CONF_E_UNKNOWN; } + ll_create(&pllcomment); /* don't care if we lose comments */ + comment = NULL; pllcurrent=NULL; /* got what will be the root of the config tree, now start walking through * the input file, populating the tree */ - while(fgets(linebuffer,conf_LINEBUFFER,fin)) { + while(fgets(linebuffer,CONF_LINEBUFFER,fin)) { line++; - linebuffer[conf_LINEBUFFER] = '\0'; + linebuffer[CONF_LINEBUFFER] = '\0'; comment=strchr(linebuffer,'#'); if(comment) { - /* we should really preserve these in another tree*/ *comment = '\0'; + comment++; } while(strlen(linebuffer) && (strchr("\n\r ",linebuffer[strlen(linebuffer)-1]))) diff --git a/src/smart-parser.c b/src/smart-parser.c index 02168038..4ea347ab 100644 --- a/src/smart-parser.c +++ b/src/smart-parser.c @@ -535,7 +535,7 @@ int sp_scan(PARSETREE tree, int hint) { tree->token.token_id = T_ERROR; return T_ERROR; } - tree->current++; /* absorb it*/ + tree->current++; /* absorb it*/ } else { if(is_qstr) { tree->in_string = 1; /* guess we're in a string */ diff --git a/src/tabs.sh b/src/tabs.sh new file mode 100755 index 00000000..9623eca5 --- /dev/null +++ b/src/tabs.sh @@ -0,0 +1,5 @@ +#!/bin/sh +XX=' ' +echo "Searching for ${XX}." + +egrep "${XX}" *.[ch]