Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f043e599d017b1a16451f67213d2feaadda2ebbb
Ticket: 3401704fffffffffffffffffffffffffffffffff
expr parses numbers before function names
User & Date: ferrieux on 2011-09-01 00:15:04
Changes

  1. icomment:
    It looks like TclParseNumber tries to mimic strtod. Quoting the manpage:
    
     The  strtod(),  strtof(),  and  strtold() functions convert the initial
     portion of the string pointed to by nptr to  double,  float,  and  long
     double representation, respectively.
    
    The attached patch fixes the issue by detecting trailers after Nan and Inf[inity].
    Trailers currently defined as [0-9A-Za-z_], should be generalized (is there a function for that ?).
    
    In case they are detected, the number parser bails out, and [expr] reports the correct "invalid bareword nancy" or "invalid command name ::tcl::mathfunc::nancy depending on the context. 
    
    
    
    
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"
  4. username: "ferrieux"