summaryrefslogtreecommitdiffstats
path: root/generic/tclStrIdxTree.c
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2019-07-15 12:18:52 (GMT)
committersebres <sebres@users.sourceforge.net>2019-07-15 12:18:52 (GMT)
commit8b9f762113baf4a70fff339bc583e8861c2a7e55 (patch)
tree4a5bf7adba651d8dd8e860e0713c1f407f975a29 /generic/tclStrIdxTree.c
parentedf6700ad972bb513f4173551ed6d98cd7a05694 (diff)
downloadtcl-8b9f762113baf4a70fff339bc583e8861c2a7e55.zip
tcl-8b9f762113baf4a70fff339bc583e8861c2a7e55.tar.gz
tcl-8b9f762113baf4a70fff339bc583e8861c2a7e55.tar.bz2
Fixes sebres/tclclockmod#18 (Fails to parse short month name for June);
The reason for that was the wrong length calculation by scanning through my string index tree, so the ambiguity check `j->(jan,ju->(jun,jul))` failed for 2nd element Ju(ne) with length 2. Simple fix and test-cases covering that, but it looks like this has a good potential for speedup (todo: move length calculation from search to build)
Diffstat (limited to 'generic/tclStrIdxTree.c')
-rw-r--r--generic/tclStrIdxTree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclStrIdxTree.c b/generic/tclStrIdxTree.c
index 88a64c6..a54b548 100644
--- a/generic/tclStrIdxTree.c
+++ b/generic/tclStrIdxTree.c
@@ -96,7 +96,7 @@ TclStrIdxTreeSearch(
/* search in tree */
do {
cinf = cin = TclGetString(item->key) + offs;
- f = TclUtfFindEqualNCInLwr(s, end, cin, cin + item->length, &cinf);
+ f = TclUtfFindEqualNCInLwr(s, end, cin, cin + item->length - offs, &cinf);
/* if something was found */
if (f > s) {
/* if whole string was found */