Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2003-10-14
22:45 • Ticket [760872ffff] ellipsis logic is not Unicode-safe status still Closed w... artifact: 01477dc08a user: dgp
22:45 • Closed ticket [760872ffff]. artifact: 0214b6962f user: dgp
2003-07-19
06:35 • Ticket [760872ffff]: 6 changes artifact: d813ee8b02 user: dgp
2003-07-17
22:50 • Ticket [760872ffff]: 4 changes artifact: 63674ad25d user: dgp
16:58 • Ticket [760872ffff]: 4 changes artifact: d00cc18294 user: vincentdarley
04:20 • Ticket [760872ffff]: 1 change artifact: 8c67db0276 user: dgp
2003-07-09
15:29 • Ticket [760872ffff]: 5 changes artifact: ad41c31ec5 user: dkf
2003-07-08
23:58 • Ticket [760872ffff]: 5 changes artifact: c34687c327 user: dgp
23:58 • Add attachment 760872.patch to ticket [760872ffff] artifact: 397764bd09 user: dgp
04:18 • Ticket [760872ffff] ellipsis logic is not Unicode-safe status still Open wit... artifact: cf3c68b797 user: dkf
03:55 • Ticket [760872ffff]: 5 changes artifact: 8dd54f1a3a user: msofer
2003-06-27
23:26 • Ticket [760872ffff]: 4 changes artifact: 69fe1c3df3 user: dgp
23:00 • Ticket [760872ffff]: 4 changes artifact: 5ad972ba89 user: dgp
2003-06-26
00:52 • New ticket [760872ffff]. artifact: 09577ac4db user: dgp

ellipsis logic is not Unicode-safe

Closed / Fixed760872ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2003-06-26 00:52:55
Tcl_LogCommandInfo truncates
messages added to the ::errorInfo
variable to at most 150 bytes in
length.

There is no check that this doesn't
break apart a UTF-8 encoded
character.

Seem more sensible to truncate
based on the number of characters
rather than the number of bytes.

Tests init-4.6.* have been committed
to call attention to this problem

There are similar ellipsis issues
in tclProc.c, tclCompile.c, and tclExecute.c.
dgpplain2003-06-27 23:00:19
Logged In: YES 
user_id=80530


the ellipsis in tclExecute.c and
one of them in tclProc.c just
write directly to stderr 
(TCL_COMPILE_DEBUG).
Since they don't store the
truncated string in ::errorInfo,
they are not bugs.
dgpplain2003-06-27 23:26:52
File Added - 54288: 760872.patch

Logged In: YES 
user_id=80530


Here's a patch.  Please review.
msoferplain2003-07-08 03:55:35
Logged In: YES 
user_id=148712

The patch applies cleanly and passes the testsuite - and
that is as far as my knowledge of unicode things allows me
to judge.
dkfplain2003-07-08 04:18:42
Logged In: YES 
user_id=79902

The patch misses a place in tclBasic.c (in function
TclObjInvoke) but otherwise looks fine from a quick glance.
dgpplain2003-07-08 23:58:24
File Deleted - 54288: 



File Added - 55273: 760872.patch

Logged In: YES 
user_id=80530

updated patch.
dkfplain2003-07-09 15:29:28
Logged In: YES 
user_id=79902

The patch looks OK on the alterations it does make, but code
review (this time, I've looked at everything that matches
".*\.\.\. so I think I've found everything :^/ ) has found
*another* two places that do ellipsis handling which might
matter:
  LogSyntaxError() in tclParseExpr.c
  TclRegError() in tclRegexp.c

Would it be easier to have a single (internal) Tcl function
to do ellipsis handling and do it right instead of spreading
the logic all over the core?

In Tk, GetEntryText in tkMacOSXMenu.c looks dodgy, but not
UNICODE-dodgy.  Just very strange and inefficient (and with
some odd spelling too.)  I'm also not 100% sure about
TkpDisplayWarning in tkWinInit.c but that might actually be
OK.  However, Tk doesn't seem to do any direct ellipsis
handling, which is good.
dgp Ticket [760872ffff]: 1 change [History diff]2003-07-17 04:20:19
vincentdarleyplain2003-07-17 16:58:36
Logged In: YES 
user_id=32170

Is it planned to put this in 8.4.4?
dgpplain2003-07-17 22:50:43
Logged In: YES 
user_id=80530


there will be some fix for the bug 
in 8.4.4, either this patch, or an
improved one I'm working on.
dgpplain2003-07-19 06:35:43
Logged In: YES 
user_id=80530


commiting this patch to get
the bug fixed for 8.4.4 release.

leaving this open for better
solutions still under development.
dgpplain2003-10-14 22:45:29
Logged In: YES 
user_id=80530

clean fix applied to HEAD that
makes use of two new internal
routines, TclAppendObjToErrorInfo()
and TclAppendLimitedToObj().
dgp Ticket [760872ffff]: 2 changes [History diff]2003-10-14 22:45:30
Log in (anonymous is fine) to add a comment.

Attachments: