summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclProc.c65
2 files changed, 38 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index b307c53..553fa96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-15 Miguel Sofer <msofer@users.sourceforge.net>
+
+ * 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.
+
2001-10-15 Andreas Kupries <andreas_kupries@users.sourceforge.net>
* generic/tclInt.decls (TclExpandCodeArray,TclGetInstructionTable):
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: