Tcl Source Code

Check-in [acbf3262a4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Proposed fix for 3414754
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-3414754
Files: files | file ages | folders
SHA1: acbf3262a4ed0f2114816eb11e295e2f5a29d12d
User & Date: dgp 2011-10-27 14:03:15
Context
2011-10-27
15:08
Added test case to the test suite check-in: 98005cd50d user: dgp tags: bug-3414754
14:03
Proposed fix for 3414754 check-in: acbf3262a4 user: dgp tags: bug-3414754
2011-10-26
17:40
merge backport check-in: 799ae39045 user: dgp tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclPathObj.c.

1363
1364
1365
1366
1367
1368
1369
















1370
1371
1372
1373
1374
1375
1376
    Tcl_Obj *head,
    Tcl_Obj *tail)
{
    int numBytes;
    const char *bytes;
    Tcl_Obj *copy = Tcl_DuplicateObj(head);

















    bytes = Tcl_GetStringFromObj(copy, &numBytes);

    /*
     * Should we perhaps use 'Tcl_FSPathSeparator'? But then what about the
     * Windows special case? Perhaps we should just check if cwd is a root
     * volume. We should never get numBytes == 0 in this code path.
     */







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
    Tcl_Obj *head,
    Tcl_Obj *tail)
{
    int numBytes;
    const char *bytes;
    Tcl_Obj *copy = Tcl_DuplicateObj(head);

#if 1
    /*
     * This is likely buggy when dealing with virtual filesystem drivers
     * that use some character other than "/" as a path separator.  I know
     * of no evidence that such a foolish thing exists.  This solution was
     * chosen so that "JoinPath" operations that pass through either path
     * intrep produce the same results; that is, bugward compatibility.  If
     * we need to fix that bug here, it needs fixing in Tcl_FSJoinPath() too.
     */
    bytes = Tcl_GetStringFromObj(tail, &numBytes);
    if (numBytes == 0) {
	Tcl_AppendToObj(copy, "/", 1);
    } else {
	TclpNativeJoinPath(copy, bytes);
    }
#else
    bytes = Tcl_GetStringFromObj(copy, &numBytes);

    /*
     * Should we perhaps use 'Tcl_FSPathSeparator'? But then what about the
     * Windows special case? Perhaps we should just check if cwd is a root
     * volume. We should never get numBytes == 0 in this code path.
     */
1394
1395
1396
1397
1398
1399
1400

1401
1402
1403
1404
1405
1406
1407
		Tcl_AppendToObj(copy, "/", 1);
	    }
	}
	break;
    }

    Tcl_AppendObjToObj(copy, tail);

    return copy;
}

/*
 *---------------------------------------------------------------------------
 *
 * TclFSMakePathRelative --







>







1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
		Tcl_AppendToObj(copy, "/", 1);
	    }
	}
	break;
    }

    Tcl_AppendObjToObj(copy, tail);
#endif
    return copy;
}

/*
 *---------------------------------------------------------------------------
 *
 * TclFSMakePathRelative --