Ticket UUID: | 760872 | |||
Title: | ellipsis logic is not Unicode-safe | |||
Type: | Bug | Version: | obsolete: 8.4.4 | |
Submitter: | dgp | Created on: | 2003-06-26 00:52:55 | |
Subsystem: | 45. Parsing and Eval | Assigned To: | dgp | |
Priority: | 5 Medium | Severity: | ||
Status: | Closed | Last Modified: | 2003-10-14 22:45:30 | |
Resolution: | Fixed | Closed By: | dgp | |
Closed on: | 2003-10-14 15:45:30 | |||
Description: |
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. | |||
User Comments: |
dgp added on 2003-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 added on 2003-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. dgp added on 2003-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. vincentdarley added on 2003-07-17 16:58:36: Logged In: YES user_id=32170 Is it planned to put this in 8.4.4? dkf added on 2003-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 added on 2003-07-08 23:58:24: File Deleted - 54288: File Added - 55273: 760872.patch Logged In: YES user_id=80530 updated patch. dkf added on 2003-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. msofer added on 2003-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. dgp added on 2003-06-27 23:26:52: File Added - 54288: 760872.patch Logged In: YES user_id=80530 Here's a patch. Please review. dgp added on 2003-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. |
Attachments:
- 760872.patch [download] added by dgp on 2003-07-08 23:58:24. [details]