Changeset 2637 in kBuild
- Timestamp:
- Sep 9, 2012 1:46:16 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/var.c
r2552 r2637 69 69 #endif 70 70 71 #if defined(_MSC_VER) || defined(_WIN32)72 /* On Windows the PATH variable is called "Path". */73 # define PC_MIXED_PATH_VAR_NAME74 #endif75 76 71 77 72 … … 364 359 int nlen; 365 360 361 fprintf(stderr, "debug: setvareq '%s'\n", s); 362 #if defined(_MSC_VER) || defined(_WIN32) 363 /* On Windows PATH is often spelled 'Path', correct this here. */ 364 if ( s[0] == 'P' 365 && s[1] == 'a' 366 && s[2] == 't' 367 && s[3] == 'h' 368 && (s[4] == '\0' || s[4] == '=') ) { 369 s[1] = 'A'; 370 s[2] = 'T'; 371 s[3] = 'H'; 372 fprintf(stderr, "debug: setvareq '%s' FIXED\n", s); 373 } 374 #endif 375 366 376 if (aflag(psh)) 367 377 flags |= VEXPORT; … … 400 410 if (flags & VNOSET) 401 411 return; 402 403 #ifdef PC_MIXED_PATH_VAR_NAME404 if ( nlen == 4405 && (s[0] == 'p' || s[0] == 'P')406 && (s[1] == 'a' || s[1] == 'A')407 && (s[2] == 't' || s[2] == 'T')408 && (s[3] == 'h' || s[3] == 'H') ) {409 s[0] = 'P';410 s[1] = 'A';411 s[2] = 'T';412 s[3] = 'H';413 }414 #endif415 412 416 413 vp = ckmalloc(psh, sizeof (*vp)); … … 928 925 len = (int)(p - name); 929 926 930 #ifdef PC_MIXED_PATH_VAR_NAME931 /* On Windows the PATH variable is called "Path". */932 if ( len == 4933 && (name[0] == 'p' || name[0] == 'P')934 && (name[1] == 'a' || name[1] == 'A')935 && (name[2] == 't' || name[2] == 'T')936 && (name[3] == 'h' || name[3] == 'H') )937 {938 name = "PATH";939 hashval = (unsigned char)'P';940 hashval = hashval * 2 + (unsigned char)'A';941 hashval = hashval * 2 + (unsigned char)'T';942 hashval = hashval * 2 + (unsigned char)'H';943 }944 #endif945 946 927 if (lenp) 947 928 *lenp = len;
Note:
See TracChangeset
for help on using the changeset viewer.