From: Heikki Levanto Date: Fri, 7 Feb 2003 15:41:28 +0000 (+0000) Subject: Minor fiddling, log functions. Still no real testables... X-Git-Tag: ZEBRA.1.3.5~13 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=322abc688457f766fbcfe5598cd83a2fbc5d0c4c Minor fiddling, log functions. Still no real testables... --- diff --git a/index/zebrash.c b/index/zebrash.c index b70343d..37dbdb1 100644 --- a/index/zebrash.c +++ b/index/zebrash.c @@ -18,6 +18,7 @@ #endif #include "zebraapi.h" +#include #define MAX_NO_ARGS 32 #define MAX_OUT_BUFF 4096 @@ -41,8 +42,10 @@ ZebraHandle zh=0; /* the current session */ static int split_args( char *line, char** args ) { /* splits line into individual null-terminated strings, * returns pointers to them in args */ + /* FIXME - do we need to handle quoted args ?? */ char *p=line; int i=0; + int n=0; args[0]=0; /* by default */ while (*p==' ' || *p=='\t' || *p=='\n') p++; @@ -50,18 +53,39 @@ static int split_args( char *line, char** args ) { while (*p==' ' || *p=='\t' || *p=='\n') p++; + if (*p=='#') /* skip comments */ + break; args[i++]=p; args[i]=0; - while (*p && *p!=' ' && *p!='\t' && *p!='\n') + while (*p && *p!=' ' && *p!='\t' && *p!='\n' && *p!='#') p++; *p++='\0'; } + n=i; + while (n