summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
authorstanton <stanton>1999-04-30 22:44:59 (GMT)
committerstanton <stanton>1999-04-30 22:44:59 (GMT)
commitfe45fa11e3df7cd37954c0f8051d9948114951b6 (patch)
treea193f27eb18d04a30f8b4f663611d5957c2f5f6a /generic/tclParse.c
parentb81b15c0f284194a10d17be0a8daa622ec578d94 (diff)
downloadtcl-fe45fa11e3df7cd37954c0f8051d9948114951b6.zip
tcl-fe45fa11e3df7cd37954c0f8051d9948114951b6.tar.gz
tcl-fe45fa11e3df7cd37954c0f8051d9948114951b6.tar.bz2
* Merged changes from 8.1.0 branch
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 0792e6e..647965a 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclParse.c,v 1.5 1999/04/21 21:50:27 rjohnson Exp $
+ * RCS: @(#) $Id: tclParse.c,v 1.6 1999/04/30 22:45:02 stanton Exp $
*/
#include "tclInt.h"
@@ -483,10 +483,7 @@ Tcl_ParseCommand(interp, string, numBytes, nested, parsePtr)
error:
string[numBytes] = (char) savedChar;
- if (parsePtr->tokenPtr != parsePtr->staticTokens) {
- ckfree((char *) parsePtr->tokenPtr);
- parsePtr->tokenPtr = parsePtr->staticTokens;
- }
+ Tcl_FreeParse(parsePtr);
if (parsePtr->commandStart == NULL) {
parsePtr->commandStart = string;
}
@@ -1743,10 +1740,7 @@ Tcl_ParseVarName(interp, string, numBytes, parsePtr, append)
return TCL_OK;
error:
- if (parsePtr->tokenPtr != parsePtr->staticTokens) {
- ckfree((char *) parsePtr->tokenPtr);
- parsePtr->tokenPtr = parsePtr->staticTokens;
- }
+ Tcl_FreeParse(parsePtr);
return TCL_ERROR;
}
@@ -1985,10 +1979,7 @@ Tcl_ParseBraces(interp, string, numBytes, parsePtr, append, termPtr)
return TCL_OK;
error:
- if (parsePtr->tokenPtr != parsePtr->staticTokens) {
- ckfree((char *) parsePtr->tokenPtr);
- parsePtr->tokenPtr = parsePtr->staticTokens;
- }
+ Tcl_FreeParse(parsePtr);
return TCL_ERROR;
}
@@ -2079,10 +2070,7 @@ Tcl_ParseQuotedString(interp, string, numBytes, parsePtr, append, termPtr)
return TCL_OK;
error:
- if (parsePtr->tokenPtr != parsePtr->staticTokens) {
- ckfree((char *) parsePtr->tokenPtr);
- parsePtr->tokenPtr = parsePtr->staticTokens;
- }
+ Tcl_FreeParse(parsePtr);
return TCL_ERROR;
}
@@ -2113,6 +2101,7 @@ CommandComplete(script, length)
{
Tcl_Parse parse;
char *p, *end;
+ int result;
p = script;
end = p + length;
@@ -2122,11 +2111,15 @@ CommandComplete(script, length)
if (*p == 0) {
break;
}
+ Tcl_FreeParse(&parse);
}
if (parse.incomplete) {
- return 0;
+ result = 0;
+ } else {
+ result = 1;
}
- return 1;
+ Tcl_FreeParse(&parse);
+ return result;
}
/*