Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d5637eb0003d5318c7b43de01571e71557cbc69d93cebec38d464f6425a94a58
Ticket: 85b7226da1ecf6194342f802ff4361bfc75b8a34
scan of data containing 0x, 0b treated differently to 0d,0o
User & Date: emiliano on 2023-08-29 13:31:48
Changes

  1. icomment:
    This looks like a bug in %x and %b specifiers; [scan] should consume only the characters in the alphabet of a given specifier.
    
    % scan 0o110 %o%s
    0 o110
    % scan 0d110 %d%s
    0 d110
    % scan 0x110 %x%s
    272 {}
    % scan 0b110 %b%s
    6 {}
    
    [regexp] already rejects hexadecimal qualifiers
    
    % regexp {^[[:xdigit:]]*$} 0xabc35d
    0
    % regexp {^[[:xdigit:]]*$} 0abc35d
    1
    
    Also, since both "b" and  "d" are members of the hexadecimal alphabet, [scan] will behave inconsistently with these numbers:
    
    % scan 0d10 %x
    3344
    % scan 0b10 %x
    2832
    % scan 0x10 %x
    16
    
  2. login: "emiliano"
  3. mimetype: "text/plain"