VirtualBox

Changeset 2552 in kBuild


Ignore:
Timestamp:
Nov 25, 2011 9:42:26 PM (13 years ago)
Author:
bird
Message:

Path fix on windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/var.c

    r2393 r2552  
    6969#endif
    7070
     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
    7177
    7278/*
     
    151157        { offsetof(shinstance, vpath),  VSTRFIXED|VTEXTFIXED,           "PATH=" _PATH_DEFPATH,
    152158          changepath },
    153 #ifdef _MSC_VER
    154         { offsetof(shinstance, vpath2), VSTRFIXED|VTEXTFIXED,           "Path=",
    155           changepath },
    156 #endif
    157159        /*
    158160         * vps1 depends on uid
     
    398400        if (flags & VNOSET)
    399401                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
    400416        vp = ckmalloc(psh, sizeof (*vp));
    401417        vp->flags = flags & ~VNOFUNC;
     
    912928        len = (int)(p - name);
    913929
     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
    914946        if (lenp)
    915947                *lenp = len;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette