Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 96a190a289ef96f877f036fa680df599614d0940
Ticket: 218697ffffffffffffffffffffffffffffffffff
Regexp Error
User & Date: nobody on 2000-10-26 01:04:14
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1780 Bug
    Version: 8.1b3
    SubmitDate: '1999-04-12'
    LastModified: '1999-08-07'
    Severity: MED
    Status: Released
    Submitter: pat
    ChangedBy: hobbs
    OS: Windows 95
    Machine: X86
    FixedDate: '1999-08-07'
    FixedInVersion: 8.2
    ClosedDate: '2000-10-25'
    
    
    Name:
    Chang LI
    
    Extensions:
    none
    
    CustomShell:
    none
    
    ReproducibleScript:
    Followig code product error result in Tcl8.1b3, but correct in 8.0.
        
        #
        #Reportreport the exception
        #statusserver status
        #keywordshort description
        #messagedetail description
        #
        proc Report {status keyword message} {
        puts "
        Status:$status
        Keyword:$keyword
        Message:$message
        "
        }
        
        #
        #ParseFormparse CGI string
        #aFormInforeturn form info array
        # ReturnRESULT_OK or RESULT_ERROR
        #
        proc ParseForm {aFormInfo} {
        upvar $aFormInfo sFormData
        
        set sReqMethod $::env(REQUEST_METHOD)
        switch -exact -- $sReqMethod {
        POST {set sQuery [read stdin $::env(CONTENT_LENGTH)]}
        GET{set sQuery $::env(QUERY_STRING)}
        default {Report  500 "server error" "unsupport method"
         return RESULT_ERROR}
        }
        
        set pairs [split $sQuery &]
        foreach item $pairs {
        set pair [split $item =]
        set key [lindex $pair 0]
        set value [lindex $pair 1]
        
        regsub -all {\+} $value { } value
        
        while {[regexp {%[0-9A-Fa-f][0-9A-Fa-f]} $value matched]} {
        scan $matched "%%%x" hex
        set symbol [format %c $hex]
        regsub -all $matched $value $symbol value
        }
        
        if {[info exists sFormData($key)]} {
        append sFormData($key) "\0" $value
        } else {
        set sFormData($key) $value
        }
        }
        return RESULT_OK
        }
        
        set ::env(REQUEST_METHOD) GET
        set ::env(QUERY_STRING)
        {user=Larry%20Bird&age=35&pass=testing&user=Wong}
        
        if {[string compare [ParseForm sForm] RESULT_OK] == 0} {
        puts "user=$sForm(user) age=$sForm(age)"
        }
    
    ObservedBehavior:
    output a high 8 bit character. 
        repeat execute with source "$filenme" to run this code get append 
        output string.
    
    DesiredBehavior:
    The output is a simple string.
    
    
    
    This works as desired in 8.2, fix must have been done along the way. 
    -- 08/07/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.1b3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "43. Regexp"
  10. title changed to: "Regexp Error"
  11. type changed to: "Bug"