aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez>2005-03-19 21:39:34 +0000
committerantirez <antirez>2005-03-19 21:39:34 +0000
commit76e16dfe41d1cad0a7f01d1a45de0cbffe525c94 (patch)
treee48c4266e7453995a5852b28b5c56a9c48e0b320
parent4212adfb46da94fa2851dd688889578127044de6 (diff)
downloadjimtcl-76e16dfe41d1cad0a7f01d1a45de0cbffe525c94.zip
jimtcl-76e16dfe41d1cad0a7f01d1a45de0cbffe525c94.tar.gz
jimtcl-76e16dfe41d1cad0a7f01d1a45de0cbffe525c94.tar.bz2
Jim_GetIndex() bug fixed (SS)
-rw-r--r--ChangeLog5
-rw-r--r--jim.c6
-rw-r--r--test.tcl36
3 files changed, 28 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 9584688..58aa94d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-19 20:12 antirez
+
+ * ChangeLog, Makefile, TODO, jim.c, jim.h: [finalize] command and
+ relative C API added (SS).
+
2005-03-18 12:39 antirez
* ChangeLog, jim.c: now [setref] returns the value assigned to the
diff --git a/jim.c b/jim.c
index b553169..9b619e4 100644
--- a/jim.c
+++ b/jim.c
@@ -1,7 +1,7 @@
/* Jim - A small embeddable Tcl interpreter
* Copyright 2005 Salvatore Sanfilippo <antirez@invece.org>
*
- * $Id: jim.c,v 1.121 2005/03/19 19:12:30 antirez Exp $
+ * $Id: jim.c,v 1.122 2005/03/19 21:39:34 antirez Exp $
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -5563,7 +5563,7 @@ int Jim_GetIndex(Jim_Interp *interp, Jim_Obj *objPtr, int *indexPtr)
if (objPtr->typePtr == &intObjType) {
jim_wide val = objPtr->internalRep.wideValue;
if (!(val < LONG_MIN) && !(val > LONG_MAX)) {
- *indexPtr = (val < 0) ? INT_MAX : (long)val;;
+ *indexPtr = (val < 0) ? -INT_MAX : (long)val;;
return JIM_OK;
}
}
@@ -10206,7 +10206,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.121 2005/03/19 19:12:30 antirez Exp $\n");
+ printf("CVS ID: $Id: jim.c,v 1.122 2005/03/19 21:39:34 antirez Exp $\n");
Jim_SetVariableStrWithStr(interp, "jim_interactive", "1");
while (1) {
char buf[1024];
diff --git a/test.tcl b/test.tcl
index 85aae73..a8f4dd4 100644
--- a/test.tcl
+++ b/test.tcl
@@ -1,4 +1,4 @@
-# $Id: test.tcl,v 1.22 2005/03/15 14:05:38 antirez Exp $
+# $Id: test.tcl,v 1.23 2005/03/19 21:39:34 antirez Exp $
#
# This are Tcl tests imported into Jim. Tests that will probably not be passed
# in the long term are usually removed (for example all the tests about
@@ -29,21 +29,6 @@ proc test {id descr script expectedResult} {
proc error {msg} { return -code error $msg }
################################################################################
-# JIM REGRESSION TESTS
-################################################################################
-test regression-1.0 {Rename against procedures with static vars} {
- proc foobar {x} {{y 10}} {
- incr y $x
- }
- foobar 30
- foobar 20
- rename foobar barfoo
- list [barfoo 1] [barfoo 2] [barfoo 3]
-} {61 63 66}
-
-rename barfoo {}
-
-################################################################################
# SET
################################################################################
@@ -3459,6 +3444,25 @@ test lrange-2.4 {error conditions} {
#} {1 {unmatched open brace in list}}
################################################################################
+# JIM REGRESSION TESTS
+################################################################################
+test regression-1.0 {Rename against procedures with static vars} {
+ proc foobar {x} {{y 10}} {
+ incr y $x
+ }
+ foobar 30
+ foobar 20
+ rename foobar barfoo
+ list [barfoo 1] [barfoo 2] [barfoo 3]
+} {61 63 66}
+
+rename barfoo {}
+
+test regression-1.1 {lrange bug with negative indexes of type int} {
+ lrange {a b c} 0 [- 0 1]
+} {}
+
+################################################################################
# FINAL REPORT
################################################################################