Skip to content
Tcl Source Code View Ticket
Login

View Ticket

[puts] accepts invalid arguments

Closed / Fixed985869ffffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-07-06 10:21:51
To duplicate:

puts stdout "this is a test." ""

Please note the extra set of double quotes after the 
string.

Line 105 of tclIOCmd.c is currently:

if (strncmp(arg, "nonewline", (size_t) length) != 0) {

I believe It SHOULD be:

if (length > 0 && strncmp(arg, "nonewline", (size_t) 
length) != 0) {
dkf Ticket [985869ffff]: 3 changes [History diff]2004-07-06 17:22:55
mistachkinplain2004-07-06 23:38:44
Logged In: YES 
user_id=113501

Oops!  What I meant to say was that the line should be:

if (length == 0 || strncmp(arg, "nonewline", (size_t) length) !
= 0) {
andreas_kupriesplain2004-07-16 03:55:08
Logged In: YES 
user_id=75003

Commited the fix to 8.4 and head. small modification:
Checking for length != 9, to accept only "nonewline", and no
abbreviation.
Log in (anonymous is fine) to add a comment.