Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-07-16
03:55 • Closed ticket [985869ffff]: puts accepts invalid arguments plus 7 other ch... artifact: 29b4660c26 user: andreas_kupries
2004-07-06
23:38 • Ticket [985869ffff]: 4 changes artifact: eea930b4b6 user: mistachkin
17:22 • Ticket [985869ffff]: 3 changes artifact: 2aa07bef5c user: dkf
10:21 • New ticket [985869ffff]. artifact: 3f9f197094 user: mistachkin

[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.