Changeset 3364 for trunk/essentials/dev-lang/python/Python/sysmodule.c
- Timestamp:
- May 21, 2007, 2:27:53 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/essentials/dev-lang/python/Python/sysmodule.c
r3225 r3364 1319 1319 /* It's a symlink */ 1320 1320 link[nr] = '\0'; 1321 if ( link[0] == SEP)1321 if (IS_ABSPATH(link)) 1322 1322 argv0 = link; /* Link to absolute path */ 1323 else if ( strchr(link, SEP) == NULL)1323 else if (!HAS_ANYSEP(link)) 1324 1324 ; /* Link without path */ 1325 1325 else { 1326 1326 /* Must join(dirname(argv0), link) */ 1327 1327 char *q = strrchr(argv0, SEP); 1328 #ifdef ALTSEP 1329 char *q2 = strrchr(q ? q : argv0, ALTSEP); 1330 if (q2) 1331 q = q2; 1332 #endif 1333 #ifdef DRVSEP 1334 if (!q && HAS_DRV(argv0)) 1335 q = strchr(argv0, DRVSEP); 1336 #endif 1337 1328 1338 if (q == NULL) 1329 1339 argv0 = link; /* argv0 without path */ … … 1331 1341 /* Must make a copy */ 1332 1342 strcpy(argv0copy, argv0); 1333 q = strrchr(argv0copy, SEP);1343 q = &argv0copy[q - argv0]; 1334 1344 strcpy(q+1, link); 1335 1345 argv0 = argv0copy; … … 1369 1379 #endif 1370 1380 p = strrchr(argv0, SEP); 1381 #ifdef ALTSEP 1382 { 1383 char *p2 = strrchr(p ? p : argv0, ALTSEP); 1384 if (p2 != NULL) 1385 p = p2; 1386 } 1387 #endif 1388 #ifdef DRVSEP 1389 if (p == NULL && HAS_DRV(argv0)) 1390 p = strchr(argv0, DRVSEP); 1391 #endif 1371 1392 } 1372 1393 if (p != NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.