Changeset 2552 in kBuild
- Timestamp:
- Nov 25, 2011 9:42:26 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/var.c
r2393 r2552 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_NAME 74 #endif 75 76 71 77 72 78 /* … … 151 157 { offsetof(shinstance, vpath), VSTRFIXED|VTEXTFIXED, "PATH=" _PATH_DEFPATH, 152 158 changepath }, 153 #ifdef _MSC_VER154 { offsetof(shinstance, vpath2), VSTRFIXED|VTEXTFIXED, "Path=",155 changepath },156 #endif157 159 /* 158 160 * vps1 depends on uid … … 398 400 if (flags & VNOSET) 399 401 return; 402 403 #ifdef PC_MIXED_PATH_VAR_NAME 404 if ( nlen == 4 405 && (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 #endif 415 400 416 vp = ckmalloc(psh, sizeof (*vp)); 401 417 vp->flags = flags & ~VNOFUNC; … … 912 928 len = (int)(p - name); 913 929 930 #ifdef PC_MIXED_PATH_VAR_NAME 931 /* On Windows the PATH variable is called "Path". */ 932 if ( len == 4 933 && (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 #endif 945 914 946 if (lenp) 915 947 *lenp = len;
Note:
See TracChangeset
for help on using the changeset viewer.