diff --git a/src/frontend/ChangeLog b/src/frontend/ChangeLog index e86093135..3080a1f65 100644 --- a/src/frontend/ChangeLog +++ b/src/frontend/ChangeLog @@ -1,3 +1,6 @@ +2003-07-08 Stefan Jones + * quote.c: return the pointer to the start of malloced + memory so it can be freeded 2003-05-02 Stuart Brorson * Major changes in subckt.c to handle POLY attributes in dependent sources. Added new case to switch in "translate" to diff --git a/src/frontend/quote.c b/src/frontend/quote.c index e4d8641af..38bba2d63 100644 --- a/src/frontend/quote.c +++ b/src/frontend/quote.c @@ -78,14 +78,15 @@ cp_unquote(char *string) char *s; int l; if (string) { - s = copy(string); + l = strlen(string); + s = MALLOC(l+1); - if (*s == '"') - s++; + if (*string == '"' && string[l-1] == '"') { + strncpy(s,string+1,l-2); + s[l-2] = '\0'; + } else + strcpy(s,string); - l = strlen(s) - 1; - if (s[l] == '"') - s[l] = '\0'; return (s); } else return 0;