Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-05
08:20 • Ticket [218446ffff] cannot pass null arguments to exec or open status still ... artifact: 987f92f22c user: dgp
2000-10-26
08:22 • Closed ticket [218446ffff]. artifact: 5d6c47855b user: welch
01:00 • New ticket [218446ffff]. artifact: 8cf1800a9c user: nobody

cannot pass null arguments to exec or open

Closed / Fixed218446ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:00:31
OriginalBugID: 546 Bug
Version: 8.0p2
SubmitDate: '1998-03-16'
LastModified: '1998-06-15'
Severity: MED
Status: Released
Submitter: stanton
ChangedBy: stanton
OS: All Windows
OSVersion: NA
Machine: NA
FixedDate: '2000-10-25'
FixedInVersion: 8.0.3
ClosedDate: '1998-06-15'


From: Darrel Schneider <[email protected]> 
Subject: Tcl exec in Windows eats empty args 
Mime-Version: 1.0 
Content-Type: text/plain; charset="us-ascii" 
X-UIDL: 77562633d5c508c83d88d4ff483072da 


I found that I couldn't pass an empty arg to an execed program on
Windows with tcl8.0p2. The fix goes in tclWinPipe.c BuildCommandLine.
The old code was:
      for (start = argv[i]; *start != '\0'; start++) {
        if (isspace(*start)) {
          quote = 1;
          Tcl_DStringAppend(linePtr, "\"", 1);
          break;
        }
      }


The new code is:
    quote = 0;
    if (argv[i][0] == '\0') {
      quote = 1;
    } else {
      for (start = argv[i]; *start != '\0'; start++) {
        if (isspace(*start)) {
          quote = 1;
          break;
        }
      }
    }
    if (quote) {
      Tcl_DStringAppend(linePtr, "\"", 1);
    }

The patch is correct.
welch Closed ticket [218446ffff]. [History diff]2000-10-26 08:22:16
dgp Ticket [218446ffff]: 3 changes [History diff]2001-04-05 08:20:13
Log in (anonymous is fine) to add a comment.