Tcl Library Source Code

View Ticket
Login
Ticket UUID: 8bb4e24bc1682ec535a19bdc708c5f22be38a3f4
Title: mime.tcl some multipart/mixed messages not parsed correctly. Errorhandling, Whitespace
Type: Bug Version: main
Submitter: oehhar Created on: 2023-08-16 09:03:00
Subsystem: mime Assigned To:
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2023-08-16 09:20:23
Resolution: None Closed By: nobody
    Closed on:
Description:
Hello,

With some upgrade of tcllib the mime package stopped to parse some multipart/mixed messages for me.

I found an extra right bracket, which would render in mime::getheader and should be the culprit, since removing it makes mime work again.

Find it in the attached diff in the chunk at line 681.

- - -

Additionally I reworked all error handling code, using only the error info given by the respective catch invocations.  The motivation for this was to use the Jim Tcl interpreter, which does not provide the global ::errorInfo variable. But there is more to it.  There seems to have gathered some cruft around this and reworking the code surface some of this.

Please review the chunk at line 2067, where there is some fiddling around with the existence errorCode: I think w/o any real use.

Also: at line 2686  ::errorInfo seems to be set gratuitously.

- - -

At some moment I let Emacs cleanup white space, after which the diff grew a lot because of 3-space indents lurking in the code. If needed I can provide a non-whitespace cleanup diff also.
- - -

There are some '#dict set eopts -level 0' lines: I put them in while testing with the Jim Tcl interpreter, which complained about -level 1 returns.

Since the packages passes all module tests with Tcl I commented them out without digging deeper.

- - -

Please skip the first two chunks at lines 11 (patch does not deserve a copyright notice) and 24 (also just Jim Tcl testing).

- - -

Best Regards,

  Georg
User Comments: oehhar added on 2023-08-16 09:20:23:

Thanks, Georg, for the ticket (and your presentation in Vienna). The spurious "]" is a clear error I have fixed in trunk with commit [42266acec4].

The rest of the ticket is more strategic and should be done by a skilful person.

Thanks again, Harald


Attachments: