Index: ossp-pkg/cfg/Makefile RCS File: /v/ossp/cvs/ossp-pkg/cfg/Attic/Makefile,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/cfg/Attic/Makefile,v' 2>/dev/null --- Makefile 2002/07/05 17:30:23 1.6 +++ Makefile 2002/07/08 13:45:13 1.7 @@ -16,6 +16,7 @@ RM = rm -f BISON = bison FLEX = flex-beta +GDB = gdb LIB = libcfg.a OBJ = cfg_buf.o cfg_grid.o cfg_data.o cfg_node.o cfg_fmt.o cfg_syn.o cfg_syn_parse.o cfg_syn_scan.o cfg_util.o @@ -53,3 +54,6 @@ ./$(TST) sample.cfg ./$(TST) sample2.cfg +debug: $(TST) + $(GDB) $(TST) + Index: ossp-pkg/cfg/cfg_syn.c RCS File: /v/ossp/cvs/ossp-pkg/cfg/cfg_syn.c,v rcsdiff -q -kk '-r1.9' '-r1.10' -u '/v/ossp/cvs/ossp-pkg/cfg/cfg_syn.c,v' 2>/dev/null --- cfg_syn.c 2002/07/05 20:49:58 1.9 +++ cfg_syn.c 2002/07/08 13:45:13 1.10 @@ -109,7 +109,15 @@ /* determine first and last positions of token */ cpF = ctx->inputbuf+loc->first; + if (cpF < ctx->inputbuf) + cpF = ctx->inputbuf; + if (cpF > ctx->inputbuf+ctx->inputlen) + cpF = ctx->inputbuf+ctx->inputlen; cpL = ctx->inputbuf+loc->last; + if (cpL < ctx->inputbuf) + cpL = ctx->inputbuf; + if (cpL > ctx->inputbuf+ctx->inputlen) + cpL = ctx->inputbuf+ctx->inputlen; /* determine epilog and prolog of token */ cpP = cpF-4; Index: ossp-pkg/cfg/cfg_syn_scan.l RCS File: /v/ossp/cvs/ossp-pkg/cfg/cfg_syn_scan.l,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/cfg/cfg_syn_scan.l,v' 2>/dev/null --- cfg_syn_scan.l 2002/07/06 18:44:46 1.6 +++ cfg_syn_scan.l 2002/07/08 13:45:13 1.7 @@ -101,6 +101,10 @@ (.|\n) { /* no-op */ } +<> { + cfg_syn_error(CTX, CFG_ERR_SYN, yylloc, "unterminated C-style block comment"); + return 0; +} /* C++-style EOL comment */ "//"[^\n]* { @@ -159,6 +163,10 @@ (.|\n) { *cpStr++ = yytext[1]; } +<> { + cfg_syn_error(CTX, CFG_ERR_SYN, yylloc, "unterminated double-quoted string"); + return 0; +} /* single-quoted word ('...') */ \' { @@ -189,6 +197,10 @@ (.|\n) { *cpStr++ = yytext[1]; } +<> { + cfg_syn_error(CTX, CFG_ERR_SYN, yylloc, "unterminated single-quoted string"); + return 0; +} /* flexible-quoted word (q(.)[^\1]\1) the delimiting character has to one a special character c, i.e., @@ -235,6 +247,10 @@ else *cpStr++ = yytext[0]; } +<> { + cfg_syn_error(CTX, CFG_ERR_SYN, yylloc, "unterminated flexible-quoted string"); + return 0; +} /* special tokens */ ";" { return T_SEP; }