Changeset 10 for python/trunk/Python/sysmodule.c
- Timestamp:
- Sep 3, 2010, 5:33:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk/Python/sysmodule.c
r2 r10 1556 1556 /* It's a symlink */ 1557 1557 link[nr] = '\0'; 1558 if ( link[0] == SEP)1558 if (IS_ABSPATH(link)) 1559 1559 argv0 = link; /* Link to absolute path */ 1560 else if ( strchr(link, SEP) == NULL)1560 else if (!HAS_ANYSEP(link)) 1561 1561 ; /* Link without path */ 1562 1562 else { 1563 1563 /* Must join(dirname(argv0), link) */ 1564 1564 char *q = strrchr(argv0, SEP); 1565 #ifdef ALTSEP 1566 char *q2 = strrchr(q ? q : argv0, ALTSEP); 1567 if (q2) 1568 q = q2; 1569 #endif 1570 #ifdef DRVSEP 1571 if (!q && HAS_DRV(argv0)) 1572 q = strchr(argv0, DRVSEP); 1573 #endif 1574 1565 1575 if (q == NULL) 1566 1576 argv0 = link; /* argv0 without path */ … … 1568 1578 /* Must make a copy */ 1569 1579 strcpy(argv0copy, argv0); 1570 q = strrchr(argv0copy, SEP);1580 q = &argv0copy[q - argv0]; 1571 1581 strcpy(q+1, link); 1572 1582 argv0 = argv0copy; … … 1609 1619 #endif 1610 1620 p = strrchr(argv0, SEP); 1621 #ifdef ALTSEP 1622 { 1623 char *p2 = strrchr(p ? p : argv0, ALTSEP); 1624 if (p2 != NULL) 1625 p = p2; 1626 } 1627 #endif 1628 #ifdef DRVSEP 1629 if (p == NULL && HAS_DRV(argv0)) 1630 p = strchr(argv0, DRVSEP); 1631 #endif 1611 1632 } 1612 1633 if (p != NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.