cp_unqoute(), avoid segfault when applied to a single quote "\""

This commit is contained in:
rlar 2010-09-19 14:09:12 +00:00
parent 83da42e3bf
commit d76862055e
2 changed files with 13 additions and 2 deletions

View File

@ -1,7 +1,18 @@
2010-09-19 Robert Larice
* src/frontend/quote.c :
cp_unqoute(), avoid segfault when applied to a single quote "\""
testcase:
.control
echo "--"
.endc
FIXME, still not completely done,
inp_stripcomments_line()
will fail on comments inside of strings
2010-09-19 Holger Vogt
* src/spinit.in, configure.ac: allow lib64 in spinit (bug no. 3054424)
if libdir contains lib64
* compile_min.sh: new script for compiling MINGW 32 and 64 bit
* compile_min.sh: new script for compiling MINGW 32 and 64 bit
2010-09-18 Holger Vogt
* src/XSPICE/icm/makedefs.in: external LDFLAGS enabled for MINGW

View File

@ -81,7 +81,7 @@ cp_unquote(char *string)
l = strlen(string);
s = (char*) MALLOC(l+1);
if (*string == '"' && string[l-1] == '"') {
if (l>=2 && *string == '"' && string[l-1] == '"') {
strncpy(s,string+1,l-2);
s[l-2] = '\0';
} else