* tcl 8.4.1 unexpected initial 0a character in stdin on cygwin/Win98
@ 2004-08-03 20:36 Patrick Samson
0 siblings, 0 replies; only message in thread
From: Patrick Samson @ 2004-08-03 20:36 UTC (permalink / raw)
To: insight
The described problem is on a Cygwin version of TCL,
running on Win98.
Doesn't appear on Cygwin/NT4 or W2000, nor on
win version of TCL on Win98.
Run this test.tcl:
------------------
puts "Do you want to continue? (Y/N)"
gets stdin rep
if {[string compare [string toupper "$rep"] "Y"]!=0} {
puts "No"
} else {
puts "Yes"
}
exit
------------------
It says:
$ /usr/bin/tclsh84 /cygdrive/c/temp/test.tcl
Do you want to continue? (Y/N)
No
$
without waiting for any keyboard entry !
As a checker, run this test2.tcl:
------------------
set rep [read stdin 1]
binary scan $rep H* str
puts "rep=$str"
------------------
It says:
$ /usr/bin/tclsh84 /cygdrive/c/temp/test2.tcl
rep=0a
$
Where does this 0a come from?
Is it a remainder of a CR LF sequence somewhere?
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-08-03 20:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-03 20:36 tcl 8.4.1 unexpected initial 0a character in stdin on cygwin/Win98 Patrick Samson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).