[Refdb-cvs] CVS: refdb/src refdbc.c,1.64,1.65
Status: Beta
Brought to you by:
mhoenicka
|
From: Markus H. <mho...@us...> - 2004-01-31 20:09:30
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21811 Modified Files: refdbc.c Log Message: com_getref(): add single quotes for quoted items after string parsing Index: refdbc.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbc.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -U2 -r1.64 -r1.65 --- refdbc.c 29 Jan 2004 01:42:15 -0000 1.64 +++ refdbc.c 31 Jan 2004 20:07:42 -0000 1.65 @@ -2145,8 +2145,13 @@ else { if (optind < inargc) { + int open_quote = 0; strcat(slvals.outbuffer, "\""); /* printf("%d\n", optind); */ for (i = optind; i < inargc; i++) { strcat(slvals.outbuffer, inargv[i]); + if (open_quote) { + strcat(slvals.outbuffer, "\'"); + open_quote--; + } /* the tokenizer returns a quoted item as a separate token even if there is no space between e.g. a '=' and the @@ -2156,6 +2161,12 @@ strcat(slvals.outbuffer, " "); } + else { + /* insert a quote after the '='. This will put back the + quote only for items that actually were quoted */ + strcat(slvals.outbuffer, "\'"); + open_quote++; + } } - strcpy(&slvals.outbuffer[strlen(slvals.outbuffer)-1], "\""); /* remove trailing space */ + strcpy(&slvals.outbuffer[strlen(slvals.outbuffer)-1], "\""); /* remove trailing space */ } } |