Skip to content
Tcl Source Code Attachment Details
Login

Attachment Details

Overview

Artifact ID: 5a89527bd3bd0ad17e6aa18ae1d4a9ccb9c0ef07
Ticket: 528669ffffffffffffffffffffffffffffffffff
Date: 2002-03-12 04:12:54
User: davygrvy
Artifact Attached: 5b721c823307ea3a6c541e6c366151f09ce88d6c
Filename:patch.txt
Description:
Content:
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
Index: tclWinPipe.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinPipe.c,v
retrieving revision 1.23
diff -c -r1.23 tclWinPipe.c
*** tclWinPipe.c	25 Jan 2002 21:36:10 -0000	1.23
--- tclWinPipe.c	11 Mar 2002 21:01:27 -0000
***************
*** 1552,1561 ****
  	if (arg[0] == '\0') {
  	    quote = 1;
  	} else {
! 	    for (start = arg; *start != '\0'; start++) {
! 		if (isspace(*start)) { /* INTL: ISO space. */
! 		    quote = 1;
! 		    break;
  		}
  	    }
  	}
--- 1552,1566 ----
  	if (arg[0] == '\0') {
  	    quote = 1;
  	} else {
! 	    // quote the whole arg for a starting quote.
! 	    if (*arg == '"') {
! 		quote = 1;
! 	    } else {
! 		for (start = arg; *start != '\0'; start++) {
! 		    if (isspace(*start)) {
! 			quote = 1;
! 			break;
! 		    }
  		}
  	    }
  	}
***************
*** 1565,1595 ****
  
  	start = arg;	    
  	for (special = arg; ; ) {
! 	    if ((*special == '\\') && 
! 		    (special[1] == '\\' || special[1] == '"')) {
! 		Tcl_DStringAppend(&ds, start, special - start);
! 		start = special;
! 		while (1) {
! 		    special++;
! 		    if (*special == '"') {
! 			/* 
! 			 * N backslashes followed a quote -> insert 
! 			 * N * 2 + 1 backslashes then a quote.
! 			 */
! 
! 			Tcl_DStringAppend(&ds, start, special - start);
! 			break;
! 		    }
! 		    if (*special != '\\') {
! 			break;
! 		    }
! 		}
! 		Tcl_DStringAppend(&ds, start, special - start);
! 		start = special;
! 	    }
! 	    if (*special == '"') {
  		Tcl_DStringAppend(&ds, start, special - start);
! 		Tcl_DStringAppend(&ds, "\\\"", 2);
  		start = special + 1;
  	    }
  	    if (*special == '\0') {
--- 1570,1578 ----
  
  	start = arg;	    
  	for (special = arg; ; ) {
! 	    if (*special == '"' && quote) {
  		Tcl_DStringAppend(&ds, start, special - start);
! 		Tcl_DStringAppend(&ds, "\"\"", 2);
  		start = special + 1;
  	    }
  	    if (*special == '\0') {