aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jim.c10
-rw-r--r--regtest.tcl5
2 files changed, 10 insertions, 5 deletions
diff --git a/jim.c b/jim.c
index 0c471e0..ee7ed46 100644
--- a/jim.c
+++ b/jim.c
@@ -6558,13 +6558,13 @@ static int ListSortElements(Jim_Interp *interp, Jim_Obj *listObjPtr, struct lsor
if ((rc = setjmp(info->jmpbuf)) == 0) {
qsort(vector, len, sizeof(Jim_Obj *), (qsort_comparator *) fn);
- }
- if (info->unique && len > 1) {
- ListRemoveDuplicates(listObjPtr, fn);
- }
+ if (info->unique && len > 1) {
+ ListRemoveDuplicates(listObjPtr, fn);
+ }
- Jim_InvalidateStringRep(listObjPtr);
+ Jim_InvalidateStringRep(listObjPtr);
+ }
sort_info = prev_info;
return rc;
diff --git a/regtest.tcl b/regtest.tcl
index acda96e..a0b063c 100644
--- a/regtest.tcl
+++ b/regtest.tcl
@@ -219,6 +219,11 @@ puts "TEST 29 PASSED"
string tolower "/mod/video/h\303\203\302\244xan_ witchcraft through the ages_20131101_0110.t"
puts "TEST 30 PASSED"
+# REGTEST 31
+# infinite lsort -unique with error
+catch {lsort -unique -real {foo 42.0}}
+puts "TEST 31 PASSED"
+
# TAKE THE FOLLOWING puts AS LAST LINE
puts "--- ALL TESTS PASSED ---"