diff options
author | antirez <antirez> | 2005-03-28 17:47:15 +0000 |
---|---|---|
committer | antirez <antirez> | 2005-03-28 17:47:15 +0000 |
commit | d6f57adaa070c9e06d6d2e2e90edf166afea7933 (patch) | |
tree | f7f9c9a49e6ac8429c3109d4949a84072354b17f /jim.c | |
parent | fdf5499a95b2aad40243e1d5a16334096115b0f2 (diff) | |
download | jimtcl-d6f57adaa070c9e06d6d2e2e90edf166afea7933.zip jimtcl-d6f57adaa070c9e06d6d2e2e90edf166afea7933.tar.gz jimtcl-d6f57adaa070c9e06d6d2e2e90edf166afea7933.tar.bz2 |
The behaviour of [scope] modified a bit. Test updated accordingly.
Diffstat (limited to 'jim.c')
-rw-r--r-- | jim.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -2,7 +2,7 @@ * Copyright 2005 Salvatore Sanfilippo <antirez@invece.org> * Copyright 2005 Clemens Hintze <c.hintze@gmx.net> * - * $Id: jim.c,v 1.131 2005/03/28 16:57:36 antirez Exp $ + * $Id: jim.c,v 1.132 2005/03/28 17:47:15 antirez Exp $ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -10764,7 +10764,8 @@ static int Jim_ScopeCoreCommand(Jim_Interp *interp, int argc, Jim_WrongNumArgs(interp, 1, argv, "varList body"); return JIM_ERR; } - /* Save the value of every var in varList into the 'savedVect' vector. */ + /* Save the value of every var in varList into the 'savedVect' vector. + * Also unset every var name. */ Jim_ListLength(interp, argv[1], &len); savedVect = Jim_Alloc(len*sizeof(Jim_Obj*)); for (i = 0; i < len; i++) { @@ -10772,6 +10773,7 @@ static int Jim_ScopeCoreCommand(Jim_Interp *interp, int argc, savedVect[i] = Jim_GetVariable(interp, varNameObjPtr, JIM_NONE); if (savedVect[i] != NULL) Jim_IncrRefCount(savedVect[i]); + Jim_UnsetVariable(interp, varNameObjPtr, JIM_NONE); } /* Eval the body */ retCode = Jim_EvalObj(interp, argv[2]); @@ -10924,7 +10926,7 @@ int Jim_InteractivePrompt(Jim_Interp *interp) printf("Welcome to Jim version %d.%d, " "Copyright (c) 2005 Salvatore Sanfilippo\n", JIM_VERSION / 100, JIM_VERSION % 100); - printf("CVS ID: $Id: jim.c,v 1.131 2005/03/28 16:57:36 antirez Exp $\n"); + printf("CVS ID: $Id: jim.c,v 1.132 2005/03/28 17:47:15 antirez Exp $\n"); Jim_SetVariableStrWithStr(interp, "jim_interactive", "1"); while (1) { char buf[1024]; |