summaryrefslogtreecommitdiffstats
path: root/generic/tclProc.c
diff options
context:
space:
mode:
authormsofer <msofer@noemail.net>2001-10-15 22:15:18 (GMT)
committermsofer <msofer@noemail.net>2001-10-15 22:15:18 (GMT)
commitcc6997bd24a87e75597af5e2fbce989a45b15697 (patch)
tree0744a4b6189f8db09fd0408fa51a79bd6881232e /generic/tclProc.c
parentd32ec1a15064686344d36059d1a4bbda4b37084a (diff)
downloadtcl-cc6997bd24a87e75597af5e2fbce989a45b15697.zip
tcl-cc6997bd24a87e75597af5e2fbce989a45b15697.tar.gz
tcl-cc6997bd24a87e75597af5e2fbce989a45b15697.tar.bz2
generic/tclProc.c: changing a memcmp to strcmp to avoid a memory error
detected by purify (thanks Jeff); modify style to agrre with the style guide. FossilOrigin-Name: f098f852b940ab707e648fbb504b694cde6a53f2
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r--generic/tclProc.c65
1 files changed, 32 insertions, 33 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index f2efa09..d7e06e3 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclProc.c,v 1.29 2001/09/27 20:32:35 dgp Exp $
+ * RCS: @(#) $Id: tclProc.c,v 1.30 2001/10/15 22:15:19 msofer Exp $
*/
#include "tclInt.h"
@@ -70,7 +70,7 @@ Tcl_ProcObjCmd(dummy, interp, objc, objv)
register Interp *iPtr = (Interp *) interp;
Proc *procPtr;
char *fullName;
- CONST char *procName;
+ CONST char *procName, *procArgs, *procBody;
Namespace *nsPtr, *altNsPtr, *cxtNsPtr;
Tcl_Command cmd;
Tcl_DString ds;
@@ -164,39 +164,38 @@ Tcl_ProcObjCmd(dummy, interp, objc, objv)
* compilation of all procs whose argument list is just _args_
*/
- {
- char *txt;
- txt = Tcl_GetString(objv[2]);
-
- while(*txt == ' ') txt++;
-
- if ((txt[0] == 'a') && (memcmp(txt, "args", 4) == 0)) {
- txt +=4;
- while(*txt != '\0') {
- if (*txt != ' ') {
- goto done;
- }
- txt++;
- }
+ procArgs = Tcl_GetString(objv[2]);
- /*
- * The argument list is just "args"; check the body
- */
-
- txt = Tcl_GetString(objv[3]);
- while(*txt != '\0') {
- if (!isspace(*txt)) {
- goto done;
- }
- txt++;
- }
+ while(*procArgs == ' ') {
+ procArgs++;
+ }
- /*
- * The body is just spaces: link the compileProc
- */
-
- ((Command *) cmd)->compileProc = TclCompileNoOp;
- }
+ if ((procArgs[0] == 'a') && (strcmp(procArgs, "args") == 0)) {
+ procArgs +=4;
+ while(*procArgs != '\0') {
+ if (*procArgs != ' ') {
+ goto done;
+ }
+ procArgs++;
+ }
+
+ /*
+ * The argument list is just "args"; check the body
+ */
+
+ procBody = Tcl_GetString(objv[3]);
+ while(*procBody != '\0') {
+ if (!isspace(*procBody)) {
+ goto done;
+ }
+ procBody++;
+ }
+
+ /*
+ * The body is just spaces: link the compileProc
+ */
+
+ ((Command *) cmd)->compileProc = TclCompileNoOp;
}
done: