Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2000-10-26
08:22 • Closed ticket [218438ffff]: Control-Z in string generates incorrect error on Win... artifact: 1aec4914e6 user: welch
00:57 • New ticket [218438ffff]. artifact: 761df7fbff user: nobody

Control-Z in string generates incorrect error on Windows

Closed / Fixed218438ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:57:36
OriginalBugID: 6208 Bug
Version: 8.3.1
SubmitDate: '2000-09-05'
LastModified: '2000-09-05'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: Windows 98
OSVersion: Windows 98
Machine: Toshiba laptop
FixedDate: '2000-10-25'
ClosedDate: '2000-09-05'


Name:
Mace Moneta

Comments:
This took a very long time to isolate, due to the misleading error
    message, since the actual code for the routine was VERY large.  While
    not a serious problem (it is easily worked around), it is very painful
    to debug.

ReproducibleScript:
The following script executes correctly on Linux/Uniz, but generates a misleading error on Windows98.  Note that the comparison string contains only a control-Z character ("\032"):

proc {sample} {} {

   if {$cmd == "^Z"} {
      set temp_cmd $cmd
   }
}

puts "hello"

ObservedBehavior:
On Unix/Linux, the operation is correct:

$ tclsh tcl.bug
hello

However on Windows98, a misleading error is displayed:

C:\My Documents\TCL>tclsh83 tcl.bug
missing close-brace
    while executing
"proc {sample} {}"
    (file "tcl.bug" line 1)

DesiredBehavior:
I expect the Windows version to execute the same as the Unix version when referencing control characters in quoted strings.



^Z has been the EOF char since ages on Windows, and it is VERY IMPORTANT
TO NOTE that Tcl8.4 extends that fact to Unix/Mac as well by default.
This enables very interesting apps like Scripted Documents (see TclKit
by Jean-Claude Wippler), and straightens out the cross-platform
irregularity.

You can use the "\032" octal encoding more safely, or the alternative
\u001a unicode encoding style. 
-- 09/05/2000 hobbs
welch Closed ticket [218438ffff]. [History diff]2000-10-26 08:22:15
Log in (anonymous is fine) to add a comment.