Skip to content
Tcl Source Code History Of Ticket b8e82d293b
Login

History Of Ticket b8e82d293b

Artifacts Associated With Ticket b8e82d293b

  1. Ticket change [d4f9f3650b] (rid 180869) by dgp on 2020-03-30 16:38:24:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      % binary decode uuencode [binary encode uuencode -maxlen 3 abc]
      aŒ*
      
    5. foundin initialized to: "all"
    6. is_private initialized to: "0"
    7. login: "dgp"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Important"
    11. status initialized to: "Open"
    12. submitter initialized to: "dgp"
    13. subsystem initialized to: "12. ByteArray Object"
    14. title initialized to: "accepted -maxlen value breaks uuencode round trip"
    15. type initialized to: "Bug"
  2. Ticket change [949d1a9056] (rid 180870) by dgp on 2020-03-30 17:00:55:

    1. icomment:
      
      It appears that the constraints of the encoding itself demand that each
      line have length l where (l - 1) % 4 == 0. A first byte to encode a length,
      followed by some whole number of 4 byte groups, each encoding 3 bytes.
      This suggests legal values of -maxlen are
      
      5, 9, 13, 17, ...., 61 (default), 65, ... SOME LIMIT TBD
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  3. Ticket change [8740b1cde9] (rid 180871) by dgp on 2020-03-30 18:02:07:

    1. icomment:
      
      Bug was introduced by this checkin
      
      https://core.tcl-lang.org/tcl/info/c001d40665
      
      which intended to fix a bug
      
      https://core.tcl-lang.org/tcl/info/2152292
      
      which essentially called for a complete rewrite because we were "doing it wrong".
      
      Unfortunately, doing it "right" makes an encoding that doesn't roundtrip.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  4. Ticket change [bb49b1e06f] (rid 180872) by dgp on 2020-03-30 18:20:10:

    1. assignee changed to: "dkf"
    2. icomment:
      
      Assigned to dkf just to get attention and input.
      
      I'd really like to be talked into the position that a uuencoder ought not have
      -maxlen or -wrapchar options in the first place, and ours only got them because
      of an implementation quirk that "forced" options intended for base64 onto uuencode too.
      
      Then we could have our option parser continue to tolerate them, but ignore them
      and always produce standard uuencode format (maxlen == 61, wrapchar == \n).
      
    3. login: "dgp"
    4. mimetype: "text/plain"
  5. Ticket change [f3b027f74a] (rid 180873) by dgp on 2020-03-30 18:22:29:

    1. icomment:
      
      Some more examples:
      
      % set code [binary encode uuencode -maxlen 21 [string repeat abc 10]]
      /86)C86)C86)C86)C86)C
      /86)C86)C86)C86)C86)C
      
      % binary decode uuencode $code
      abcabcabcabcabcabcabcabcabcabc
      
      % set code [binary encode uuencode -maxlen 20 [string repeat abc 10]]
      .86)C86)C86)C86)C86(
      .8V%B8V%B8V%B8V%B8V$
      "8F,
      
      % binary decode uuencode $code
      abcabcabcabcabØX˜ØX˜ØX˜ØX˜Ø@˜˜Ê 
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  6. Ticket change [01b9e3fd77] (rid 180879) by jan.nijtmans on 2020-03-31 06:17:15:

    1. icomment:
      Suggestion: How about rounding the -maxlen down to the first lower valid value? So -maxlen 6 behaves the same as -maxlen 5, just as -maxlen 8. That restores the round-trip, and still assures that the maximum line length is the supplied value. I think that's better than ignoring the values, however useless they may be. Maxlengths bigger than 77 (the absolute maximum, using length letter ']', should behave the same as -maxlen 77
      
      Just my 2c
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  7. Ticket change [327579379a] (rid 180891) by jan.nijtmans on 2020-03-31 09:08:02:

    1. icomment:
      Correction to the previous comment: The maximum line length is 85, which results in the length character '_'.
      
      <pre>
      % binary encode uuencode -maxlen 86 xxx
      line length out of range
      </pre>
      
      So, it appears that that's already taken care of.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [601b1dd3b9] (rid 180913) by dgp on 2020-03-31 11:55:49:

    1. icomment:
      
      Thanks for the review and alternative solution. Will have a look.
      
      Meanwhile, can you confirm that allowing -wrapchar to be anything other than \n
      also breaks roundtrip? The requirement that each "line" of the encoded format
      must end in the \n character sure appears to be directly embedded in the decoder.
      
      Again, these options were not added to the uuencode encode because they were
      standard or useful. They were just accepted because they came along with the
      base64 encoder it once shared an implementation with.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  9. Ticket change [35c276c0a3] (rid 180922) by jan.nijtmans on 2020-03-31 14:30:10:

    1. icomment:
      > Meanwhile, can you confirm that allowing -wrapchar to be anything other than \n
      also breaks roundtrip?
      
      Confirmed. There are two direct checks with '\n' in the code (tclBinary.c lines 2800 and 2837). This means that changing -wrapchar means no roundtrip. Does it really matter? This could simply be documented. Or ... a "-wrapchar" option could be added to uuencode too....  No problem for now, I think, just document it.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  10. Ticket change [153ad0757f] (rid 180923) by jan.nijtmans on 2020-03-31 14:31:34:

    1. icomment:
      > a "-wrapchar" option could be added to uuencode too....
      
      Of course, I meant "uudecode" here
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  11. Ticket change [8eec4a1cd3] (rid 180924) by dgp on 2020-03-31 14:42:12:

    1. icomment:
      
      With the decoder we have, the values of -wrapchar that will not break it are
      those that match the description:
      
      A sequence of zero or more characters from the set: \v \f \t \r
      
      Followed by zero or one: \n
      
      Anything else will break decoding.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  12. Ticket change [c7f3063a3d] (rid 180925) by dgp on 2020-03-31 14:48:48:

    1. icomment:
      ...modulo the existing hackery that pulls in the -wrapchar value as a
      byte array, so that characters like U+2109 that truncate to become \t
      also "work" in a way that must be surprising.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  13. Ticket change [6a7b9029f4] (rid 180929) by dgp on 2020-03-31 15:21:59:

    1. icomment:
      
      Added value checks to enforce that restriction.
      
      Still includes the (mythical?) user out there asking for \r\n
      
      With changes in place to keep both options within their valid range, and tests
      adjusted, I plan to accept this as a fix.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  14. Ticket change [bc1d4be010] (rid 180935) by dgp on 2020-03-31 15:59:49:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2458940.16653975"
    3. closer changed to: "dgp"
    4. icomment: "Fix accepted."
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"