Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

Location:
python/vendor/current/PC/os2vacpp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/PC/os2vacpp/getpathp.c

    r2 r388  
    5656
    5757static int
    58 is_sep(char ch) /* determine if "ch" is a separator character */
     58is_sep(char ch) /* determine if "ch" is a separator character */
    5959{
    6060#ifdef ALTSEP
    61         return ch == SEP || ch == ALTSEP;
     61    return ch == SEP || ch == ALTSEP;
    6262#else
    63         return ch == SEP;
     63    return ch == SEP;
    6464#endif
    6565}
     
    6969reduce(char *dir)
    7070{
    71         int i = strlen(dir);
    72         while (i > 0 && !is_sep(dir[i]))
    73                 --i;
    74         dir[i] = '\0';
    75 }
    76        
     71    int i = strlen(dir);
     72    while (i > 0 && !is_sep(dir[i]))
     73        --i;
     74    dir[i] = '\0';
     75}
     76
    7777
    7878static int
    7979exists(char *filename)
    8080{
    81         struct stat buf;
    82         return stat(filename, &buf) == 0;
     81    struct stat buf;
     82    return stat(filename, &buf) == 0;
    8383}
    8484
     
    9696join(char *buffer, char *stuff)
    9797{
    98         int n, k;
    99         if (is_sep(stuff[0]))
    100                 n = 0;
    101         else {
    102                 n = strlen(buffer);
    103                 if (n > 0 && !is_sep(buffer[n-1]) && n < MAXPATHLEN)
    104                         buffer[n++] = SEP;
    105         }
    106         if (n > MAXPATHLEN)
    107                 Py_FatalError("buffer overflow in getpathp.c's joinpath()");
    108         k = strlen(stuff);
    109         if (n + k > MAXPATHLEN)
    110                 k = MAXPATHLEN - n;
    111         strncpy(buffer+n, stuff, k);
    112         buffer[n+k] = '\0';
     98    int n, k;
     99    if (is_sep(stuff[0]))
     100        n = 0;
     101    else {
     102        n = strlen(buffer);
     103        if (n > 0 && !is_sep(buffer[n-1]) && n < MAXPATHLEN)
     104            buffer[n++] = SEP;
     105    }
     106    if (n > MAXPATHLEN)
     107        Py_FatalError("buffer overflow in getpathp.c's joinpath()");
     108    k = strlen(stuff);
     109    if (n + k > MAXPATHLEN)
     110        k = MAXPATHLEN - n;
     111    strncpy(buffer+n, stuff, k);
     112    buffer[n+k] = '\0';
    113113}
    114114
     
    117117search_for_prefix(char *argv0_path, char *landmark)
    118118{
    119         int n;
    120 
    121         /* Search from argv0_path, until root is found */
    122         strcpy(prefix, argv0_path);
    123         do {
    124                 n = strlen(prefix);
    125                 join(prefix, landmark);
    126                 if (exists(prefix)) {
    127                         prefix[n] = '\0';
    128                         return 1;
    129                 }
    130                 prefix[n] = '\0';
    131                 reduce(prefix);
    132         } while (prefix[0]);
    133         return 0;
     119    int n;
     120
     121    /* Search from argv0_path, until root is found */
     122    strcpy(prefix, argv0_path);
     123    do {
     124        n = strlen(prefix);
     125        join(prefix, landmark);
     126        if (exists(prefix)) {
     127            prefix[n] = '\0';
     128            return 1;
     129        }
     130        prefix[n] = '\0';
     131        reduce(prefix);
     132    } while (prefix[0]);
     133    return 0;
    134134}
    135135
     
    148148getpythonregpath(HKEY keyBase, BOOL bWin32s)
    149149{
    150         HKEY newKey = 0;
    151         DWORD nameSize = 0;
    152         DWORD dataSize = 0;
    153         DWORD numEntries = 0;
    154         LONG rc;
    155         char *retval = NULL;
    156         char *dataBuf;
    157         const char keyPrefix[] = "Software\\Python\\PythonCore\\";
    158         const char keySuffix[] = "\\PythonPath";
    159         int versionLen;
    160         char *keyBuf;
    161 
    162         // Tried to use sysget("winver") but here is too early :-(
    163         versionLen = strlen(PyWin_DLLVersionString);
    164         // alloca == no free required, but memory only local to fn.
    165         // also no heap fragmentation!  Am I being silly?
    166         keyBuf = alloca(sizeof(keyPrefix)-1 + versionLen + sizeof(keySuffix)); // chars only, plus 1 NULL.
    167         // lots of constants here for the compiler to optimize away :-)
    168         memcpy(keyBuf, keyPrefix, sizeof(keyPrefix)-1);
    169         memcpy(keyBuf+sizeof(keyPrefix)-1, PyWin_DLLVersionString, versionLen);
    170         memcpy(keyBuf+sizeof(keyPrefix)-1+versionLen, keySuffix, sizeof(keySuffix)); // NULL comes with this one!
    171 
    172         rc=RegOpenKey(keyBase,
    173                       keyBuf,
    174                       &newKey);
    175         if (rc==ERROR_SUCCESS) {
    176                 RegQueryInfoKey(newKey, NULL, NULL, NULL, NULL, NULL, NULL,
    177                                 &numEntries, &nameSize, &dataSize, NULL, NULL);
    178         }
    179         if (bWin32s && numEntries==0 && dataSize==0) {
    180                 /* must hardcode for Win32s */
    181                 numEntries = 1;
    182                 dataSize = 511;
    183         }
    184         if (numEntries) {
    185                 /* Loop over all subkeys. */
    186                 /* Win32s doesnt know how many subkeys, so we do
    187                    it twice */
    188                 char keyBuf[MAX_PATH+1];
    189                 int index = 0;
    190                 int off = 0;
    191                 for(index=0;;index++) {
    192                         long reqdSize = 0;
    193                         DWORD rc = RegEnumKey(newKey,
    194                                               index, keyBuf, MAX_PATH+1);
    195                         if (rc) break;
    196                         rc = RegQueryValue(newKey, keyBuf, NULL, &reqdSize);
    197                         if (rc) break;
    198                         if (bWin32s && reqdSize==0) reqdSize = 512;
    199                         dataSize += reqdSize + 1; /* 1 for the ";" */
    200                 }
    201                 dataBuf = malloc(dataSize+1);
    202                 if (dataBuf==NULL)
    203                         return NULL; /* pretty serious?  Raise error? */
    204                 /* Now loop over, grabbing the paths.
    205                    Subkeys before main library */
    206                 for(index=0;;index++) {
    207                         int adjust;
    208                         long reqdSize = dataSize;
    209                         DWORD rc = RegEnumKey(newKey,
    210                                               index, keyBuf,MAX_PATH+1);
    211                         if (rc) break;
    212                         rc = RegQueryValue(newKey,
    213                                            keyBuf, dataBuf+off, &reqdSize);
    214                         if (rc) break;
    215                         if (reqdSize>1) {
    216                                 /* If Nothing, or only '\0' copied. */
    217                                 adjust = strlen(dataBuf+off);
    218                                 dataSize -= adjust;
    219                                 off += adjust;
    220                                 dataBuf[off++] = ';';
    221                                 dataBuf[off] = '\0';
    222                                 dataSize--;
    223                         }
    224                 }
    225                 /* Additionally, win32s doesnt work as expected, so
    226                    the specific strlen() is required for 3.1. */
    227                 rc = RegQueryValue(newKey, "", dataBuf+off, &dataSize);
    228                 if (rc==ERROR_SUCCESS) {
    229                         if (strlen(dataBuf)==0)
    230                                 free(dataBuf);
    231                         else
    232                                 retval = dataBuf; /* caller will free */
    233                 }
    234                 else
    235                         free(dataBuf);
    236         }
    237 
    238         if (newKey)
    239                 RegCloseKey(newKey);
    240         return retval;
     150    HKEY newKey = 0;
     151    DWORD nameSize = 0;
     152    DWORD dataSize = 0;
     153    DWORD numEntries = 0;
     154    LONG rc;
     155    char *retval = NULL;
     156    char *dataBuf;
     157    const char keyPrefix[] = "Software\\Python\\PythonCore\\";
     158    const char keySuffix[] = "\\PythonPath";
     159    int versionLen;
     160    char *keyBuf;
     161
     162    // Tried to use sysget("winver") but here is too early :-(
     163    versionLen = strlen(PyWin_DLLVersionString);
     164    // alloca == no free required, but memory only local to fn.
     165    // also no heap fragmentation!  Am I being silly?
     166    keyBuf = alloca(sizeof(keyPrefix)-1 + versionLen + sizeof(keySuffix)); // chars only, plus 1 NULL.
     167    // lots of constants here for the compiler to optimize away :-)
     168    memcpy(keyBuf, keyPrefix, sizeof(keyPrefix)-1);
     169    memcpy(keyBuf+sizeof(keyPrefix)-1, PyWin_DLLVersionString, versionLen);
     170    memcpy(keyBuf+sizeof(keyPrefix)-1+versionLen, keySuffix, sizeof(keySuffix)); // NULL comes with this one!
     171
     172    rc=RegOpenKey(keyBase,
     173                  keyBuf,
     174                  &newKey);
     175    if (rc==ERROR_SUCCESS) {
     176        RegQueryInfoKey(newKey, NULL, NULL, NULL, NULL, NULL, NULL,
     177                        &numEntries, &nameSize, &dataSize, NULL, NULL);
     178    }
     179    if (bWin32s && numEntries==0 && dataSize==0) {
     180        /* must hardcode for Win32s */
     181        numEntries = 1;
     182        dataSize = 511;
     183    }
     184    if (numEntries) {
     185        /* Loop over all subkeys. */
     186        /* Win32s doesnt know how many subkeys, so we do
     187           it twice */
     188        char keyBuf[MAX_PATH+1];
     189        int index = 0;
     190        int off = 0;
     191        for(index=0;;index++) {
     192            long reqdSize = 0;
     193            DWORD rc = RegEnumKey(newKey,
     194                                  index, keyBuf, MAX_PATH+1);
     195            if (rc) break;
     196            rc = RegQueryValue(newKey, keyBuf, NULL, &reqdSize);
     197            if (rc) break;
     198            if (bWin32s && reqdSize==0) reqdSize = 512;
     199            dataSize += reqdSize + 1; /* 1 for the ";" */
     200        }
     201        dataBuf = malloc(dataSize+1);
     202        if (dataBuf==NULL)
     203            return NULL; /* pretty serious?  Raise error? */
     204        /* Now loop over, grabbing the paths.
     205           Subkeys before main library */
     206        for(index=0;;index++) {
     207            int adjust;
     208            long reqdSize = dataSize;
     209            DWORD rc = RegEnumKey(newKey,
     210                                  index, keyBuf,MAX_PATH+1);
     211            if (rc) break;
     212            rc = RegQueryValue(newKey,
     213                               keyBuf, dataBuf+off, &reqdSize);
     214            if (rc) break;
     215            if (reqdSize>1) {
     216                /* If Nothing, or only '\0' copied. */
     217                adjust = strlen(dataBuf+off);
     218                dataSize -= adjust;
     219                off += adjust;
     220                dataBuf[off++] = ';';
     221                dataBuf[off] = '\0';
     222                dataSize--;
     223            }
     224        }
     225        /* Additionally, win32s doesnt work as expected, so
     226           the specific strlen() is required for 3.1. */
     227        rc = RegQueryValue(newKey, "", dataBuf+off, &dataSize);
     228        if (rc==ERROR_SUCCESS) {
     229            if (strlen(dataBuf)==0)
     230                free(dataBuf);
     231            else
     232                retval = dataBuf; /* caller will free */
     233        }
     234        else
     235            free(dataBuf);
     236    }
     237
     238    if (newKey)
     239        RegCloseKey(newKey);
     240    return retval;
    241241}
    242242#endif /* MS_WIN32 */
     
    245245get_progpath(void)
    246246{
    247         extern char *Py_GetProgramName(void);
    248         char *path = getenv("PATH");
    249         char *prog = Py_GetProgramName();
    250 
    251 #ifdef MS_WIN32
    252         if (GetModuleFileName(NULL, progpath, MAXPATHLEN))
    253                 return;
    254 #endif
    255         if (prog == NULL || *prog == '\0')
    256                 prog = "python";
    257 
    258         /* If there is no slash in the argv0 path, then we have to
    259         * assume python is on the user's $PATH, since there's no
    260         * other way to find a directory to start the search from.  If
    261         * $PATH isn't exported, you lose.
    262         */
     247    extern char *Py_GetProgramName(void);
     248    char *path = getenv("PATH");
     249    char *prog = Py_GetProgramName();
     250
     251#ifdef MS_WIN32
     252    if (GetModuleFileName(NULL, progpath, MAXPATHLEN))
     253        return;
     254#endif
     255    if (prog == NULL || *prog == '\0')
     256        prog = "python";
     257
     258    /* If there is no slash in the argv0 path, then we have to
     259    * assume python is on the user's $PATH, since there's no
     260    * other way to find a directory to start the search from.  If
     261    * $PATH isn't exported, you lose.
     262    */
    263263#ifdef ALTSEP
    264         if (strchr(prog, SEP) || strchr(prog, ALTSEP))
     264    if (strchr(prog, SEP) || strchr(prog, ALTSEP))
    265265#else
    266         if (strchr(prog, SEP))
    267 #endif
    268                 strcpy(progpath, prog);
    269         else if (path) {
    270                 while (1) {
    271                         char *delim = strchr(path, DELIM);
    272 
    273                         if (delim) {
    274                                 int len = delim - path;
    275                                 strncpy(progpath, path, len);
    276                                 *(progpath + len) = '\0';
    277                         }
    278                         else
    279                                 strcpy(progpath, path);
    280 
    281                         join(progpath, prog);
    282                         if (exists(progpath))
    283                                 break;
    284 
    285                         if (!delim) {
    286                                 progpath[0] = '\0';
    287                                 break;
    288                         }
    289                         path = delim + 1;
    290                 }
    291         }
    292         else
    293                 progpath[0] = '\0';
     266    if (strchr(prog, SEP))
     267#endif
     268        strcpy(progpath, prog);
     269    else if (path) {
     270        while (1) {
     271            char *delim = strchr(path, DELIM);
     272
     273            if (delim) {
     274                int len = delim - path;
     275                strncpy(progpath, path, len);
     276                *(progpath + len) = '\0';
     277            }
     278            else
     279                strcpy(progpath, path);
     280
     281            join(progpath, prog);
     282            if (exists(progpath))
     283                break;
     284
     285            if (!delim) {
     286                progpath[0] = '\0';
     287                break;
     288            }
     289            path = delim + 1;
     290        }
     291    }
     292    else
     293        progpath[0] = '\0';
    294294}
    295295
     
    297297calculate_path(void)
    298298{
    299         char argv0_path[MAXPATHLEN+1];
    300         char *buf;
    301         int bufsz;
    302         char *pythonhome = Py_GetPythonHome();
    303         char *envpath = Py_GETENV("PYTHONPATH");
    304 #ifdef MS_WIN32
    305         char *machinepath, *userpath;
    306 
    307         /* Are we running under Windows 3.1(1) Win32s? */
    308         if (PyWin_IsWin32s()) {
    309                 /* Only CLASSES_ROOT is supported */
    310                 machinepath = getpythonregpath(HKEY_CLASSES_ROOT, TRUE);
    311                 userpath = NULL;
    312         } else {
    313                 machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, FALSE);
    314                 userpath = getpythonregpath(HKEY_CURRENT_USER, FALSE);
    315         }
    316 #endif
    317 
    318         get_progpath();
    319         strcpy(argv0_path, progpath);
    320         reduce(argv0_path);
    321         if (pythonhome == NULL || *pythonhome == '\0') {
    322                 if (search_for_prefix(argv0_path, LANDMARK))
    323                         pythonhome = prefix;
    324                 else
    325                         pythonhome = NULL;
    326         }
    327         else {
    328         char *delim;
    329 
    330                 strcpy(prefix, pythonhome);
    331 
    332         /* Extract Any Optional Trailing EXEC_PREFIX */
    333         /* e.g. PYTHONHOME=<prefix>:<exec_prefix>   */
    334         delim = strchr(prefix, DELIM);
    335         if (delim) {
    336             *delim = '\0';
    337             strcpy(exec_prefix, delim+1);
    338         } else
    339             strcpy(exec_prefix, EXEC_PREFIX);
    340     }
    341 
    342         if (envpath && *envpath == '\0')
    343                 envpath = NULL;
    344 
    345         /* We need to construct a path from the following parts:
    346            (1) the PYTHONPATH environment variable, if set;
    347            (2) for Win32, the machinepath and userpath, if set;
    348            (3) the PYTHONPATH config macro, with the leading "."
    349                of each component replaced with pythonhome, if set;
    350            (4) the directory containing the executable (argv0_path).
    351            The length calculation calculates #3 first.
    352         */
    353 
    354         /* Calculate size of return buffer */
    355         if (pythonhome != NULL) {
    356                 char *p;
    357                 bufsz = 1;     
    358                 for (p = PYTHONPATH; *p; p++) {
    359                         if (*p == DELIM)
    360                                 bufsz++; /* number of DELIM plus one */
    361                 }
    362                 bufsz *= strlen(pythonhome);
    363         }
    364         else
    365                 bufsz = 0;
    366         bufsz += strlen(PYTHONPATH) + 1;
    367         if (envpath != NULL)
    368                 bufsz += strlen(envpath) + 1;
    369         bufsz += strlen(argv0_path) + 1;
    370 #ifdef MS_WIN32
    371         if (machinepath)
    372                 bufsz += strlen(machinepath) + 1;
    373         if (userpath)
    374                 bufsz += strlen(userpath) + 1;
    375 #endif
    376 
    377         module_search_path = buf = malloc(bufsz);
    378         if (buf == NULL) {
    379                 /* We can't exit, so print a warning and limp along */
    380                 fprintf(stderr, "Can't malloc dynamic PYTHONPATH.\n");
    381                 if (envpath) {
    382                         fprintf(stderr, "Using default static $PYTHONPATH.\n");
    383                         module_search_path = envpath;
    384                 }
    385                 else {
    386                         fprintf(stderr, "Using environment $PYTHONPATH.\n");
    387                         module_search_path = PYTHONPATH;
    388                 }
    389                 return;
    390         }
    391 
    392         if (envpath) {
    393                 strcpy(buf, envpath);
    394                 buf = strchr(buf, '\0');
    395                 *buf++ = DELIM;
    396         }
    397 #ifdef MS_WIN32
    398         if (machinepath) {
    399                 strcpy(buf, machinepath);
    400                 buf = strchr(buf, '\0');
    401                 *buf++ = DELIM;
    402         }
    403         if (userpath) {
    404                 strcpy(buf, userpath);
    405                 buf = strchr(buf, '\0');
    406                 *buf++ = DELIM;
    407         }
    408 #endif
    409         if (pythonhome == NULL) {
    410                 strcpy(buf, PYTHONPATH);
    411                 buf = strchr(buf, '\0');
    412         }
    413         else {
    414                 char *p = PYTHONPATH;
    415                 char *q;
    416                 int n;
    417                 for (;;) {
    418                         q = strchr(p, DELIM);
    419                         if (q == NULL)
    420                                 n = strlen(p);
    421                         else
    422                                 n = q-p;
    423                         if (p[0] == '.' && is_sep(p[1])) {
    424                                 strcpy(buf, pythonhome);
    425                                 buf = strchr(buf, '\0');
    426                                 p++;
    427                                 n--;
    428                         }
    429                         strncpy(buf, p, n);
    430                         buf += n;
    431                         if (q == NULL)
    432                                 break;
    433                         *buf++ = DELIM;
    434                         p = q+1;
    435                 }
    436         }
    437         if (argv0_path) {
    438                 *buf++ = DELIM;
    439                 strcpy(buf, argv0_path);
    440                 buf = strchr(buf, '\0');
    441         }
    442         *buf = '\0';
     299    char argv0_path[MAXPATHLEN+1];
     300    char *buf;
     301    int bufsz;
     302    char *pythonhome = Py_GetPythonHome();
     303    char *envpath = Py_GETENV("PYTHONPATH");
     304#ifdef MS_WIN32
     305    char *machinepath, *userpath;
     306
     307    /* Are we running under Windows 3.1(1) Win32s? */
     308    if (PyWin_IsWin32s()) {
     309        /* Only CLASSES_ROOT is supported */
     310        machinepath = getpythonregpath(HKEY_CLASSES_ROOT, TRUE);
     311        userpath = NULL;
     312    } else {
     313        machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, FALSE);
     314        userpath = getpythonregpath(HKEY_CURRENT_USER, FALSE);
     315    }
     316#endif
     317
     318    get_progpath();
     319    strcpy(argv0_path, progpath);
     320    reduce(argv0_path);
     321    if (pythonhome == NULL || *pythonhome == '\0') {
     322        if (search_for_prefix(argv0_path, LANDMARK))
     323            pythonhome = prefix;
     324        else
     325            pythonhome = NULL;
     326    }
     327    else {
     328    char *delim;
     329
     330        strcpy(prefix, pythonhome);
     331
     332    /* Extract Any Optional Trailing EXEC_PREFIX */
     333    /* e.g. PYTHONHOME=<prefix>:<exec_prefix>   */
     334    delim = strchr(prefix, DELIM);
     335    if (delim) {
     336        *delim = '\0';
     337        strcpy(exec_prefix, delim+1);
     338    } else
     339        strcpy(exec_prefix, EXEC_PREFIX);
     340    }
     341
     342    if (envpath && *envpath == '\0')
     343        envpath = NULL;
     344
     345    /* We need to construct a path from the following parts:
     346       (1) the PYTHONPATH environment variable, if set;
     347       (2) for Win32, the machinepath and userpath, if set;
     348       (3) the PYTHONPATH config macro, with the leading "."
     349           of each component replaced with pythonhome, if set;
     350       (4) the directory containing the executable (argv0_path).
     351       The length calculation calculates #3 first.
     352    */
     353
     354    /* Calculate size of return buffer */
     355    if (pythonhome != NULL) {
     356        char *p;
     357        bufsz = 1;
     358        for (p = PYTHONPATH; *p; p++) {
     359            if (*p == DELIM)
     360                bufsz++; /* number of DELIM plus one */
     361        }
     362        bufsz *= strlen(pythonhome);
     363    }
     364    else
     365        bufsz = 0;
     366    bufsz += strlen(PYTHONPATH) + 1;
     367    if (envpath != NULL)
     368        bufsz += strlen(envpath) + 1;
     369    bufsz += strlen(argv0_path) + 1;
     370#ifdef MS_WIN32
     371    if (machinepath)
     372        bufsz += strlen(machinepath) + 1;
     373    if (userpath)
     374        bufsz += strlen(userpath) + 1;
     375#endif
     376
     377    module_search_path = buf = malloc(bufsz);
     378    if (buf == NULL) {
     379        /* We can't exit, so print a warning and limp along */
     380        fprintf(stderr, "Can't malloc dynamic PYTHONPATH.\n");
     381        if (envpath) {
     382            fprintf(stderr, "Using default static $PYTHONPATH.\n");
     383            module_search_path = envpath;
     384        }
     385        else {
     386            fprintf(stderr, "Using environment $PYTHONPATH.\n");
     387            module_search_path = PYTHONPATH;
     388        }
     389        return;
     390    }
     391
     392    if (envpath) {
     393        strcpy(buf, envpath);
     394        buf = strchr(buf, '\0');
     395        *buf++ = DELIM;
     396    }
     397#ifdef MS_WIN32
     398    if (machinepath) {
     399        strcpy(buf, machinepath);
     400        buf = strchr(buf, '\0');
     401        *buf++ = DELIM;
     402    }
     403    if (userpath) {
     404        strcpy(buf, userpath);
     405        buf = strchr(buf, '\0');
     406        *buf++ = DELIM;
     407    }
     408#endif
     409    if (pythonhome == NULL) {
     410        strcpy(buf, PYTHONPATH);
     411        buf = strchr(buf, '\0');
     412    }
     413    else {
     414        char *p = PYTHONPATH;
     415        char *q;
     416        int n;
     417        for (;;) {
     418            q = strchr(p, DELIM);
     419            if (q == NULL)
     420                n = strlen(p);
     421            else
     422                n = q-p;
     423            if (p[0] == '.' && is_sep(p[1])) {
     424                strcpy(buf, pythonhome);
     425                buf = strchr(buf, '\0');
     426                p++;
     427                n--;
     428            }
     429            strncpy(buf, p, n);
     430            buf += n;
     431            if (q == NULL)
     432                break;
     433            *buf++ = DELIM;
     434            p = q+1;
     435        }
     436    }
     437    if (argv0_path) {
     438        *buf++ = DELIM;
     439        strcpy(buf, argv0_path);
     440        buf = strchr(buf, '\0');
     441    }
     442    *buf = '\0';
    443443}
    444444
     
    449449Py_GetPath(void)
    450450{
    451         if (!module_search_path)
    452                 calculate_path();
    453 
    454         return module_search_path;
     451    if (!module_search_path)
     452        calculate_path();
     453
     454    return module_search_path;
    455455}
    456456
     
    458458Py_GetPrefix(void)
    459459{
    460         if (!module_search_path)
    461                 calculate_path();
    462 
    463         return prefix;
     460    if (!module_search_path)
     461        calculate_path();
     462
     463    return prefix;
    464464}
    465465
     
    467467Py_GetExecPrefix(void)
    468468{
    469         if (!module_search_path)
    470                 calculate_path();
    471 
    472         return exec_prefix;
     469    if (!module_search_path)
     470        calculate_path();
     471
     472    return exec_prefix;
    473473}
    474474
     
    476476Py_GetProgramFullPath(void)
    477477{
    478         if (!module_search_path)
    479                 calculate_path();
    480 
    481         return progpath;
    482 }
     478    if (!module_search_path)
     479        calculate_path();
     480
     481    return progpath;
     482}
  • python/vendor/current/PC/os2vacpp/makefile

    r2 r388  
    204204                  $(PATHOBJ)\StructModule.obj  \
    205205                  $(PATHOBJ)\TimeModule.obj    \
    206                   $(PATHOBJ)\ThreadModule.obj  \
    207                   $(PATHOBJ)\YUVConvert.obj
     206                  $(PATHOBJ)\ThreadModule.obj
    208207
    209208# Standalone Parser Generator Program (Shares Some of Python's Modules)
     
    11141113         $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h $(PY_INCLUDE)\rangeobject.h \
    11151114         $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
    1116          $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h \
    1117          $(PY_MODULES)\yuv.h
     1115         $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
    11181116
    11191117syslogmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
     
    11981196         $(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
    11991197         $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
    1200 
    1201 yuvconvert.obj: $(PY_MODULES)\yuv.h
    12021198
    12031199zlibmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
     
    16971693         $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
    16981694         $(PY_INCLUDE)\tupleobject.h
    1699 
    1700 getmtime.obj: pyconfig.h
    17011695
    17021696getplatform.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
  • python/vendor/current/PC/os2vacpp/makefile.omk

    r2 r388  
    165165                  StructModule.obj  \
    166166                  TimeModule.obj    \
    167                   ThreadModule.obj  \
    168                   YUVConvert.obj
     167                  ThreadModule.obj
    169168
    170169# Omitted Modules (and Description/Reason):
     
    804803         moduleobject.h mymalloc.h myproto.h object.h objimpl.h pydebug.h \
    805804         pyerrors.h pyfpe.h pystate.h python.h pythonrun.h rangeobject.h \
    806          sliceobject.h stringobject.h sysmodule.h traceback.h tupleobject.h \
    807          yuv.h
     805         sliceobject.h stringobject.h sysmodule.h traceback.h tupleobject.h
    808806
    809807syslogmodule.obj: abstract.h ceval.h classobject.h cobject.h \
     
    854852         pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
    855853         traceback.h tupleobject.h
    856 
    857 yuvconvert.obj: yuv.h
    858854
    859855zlibmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
     
    11601156         stringobject.h sysmodule.h traceback.h tupleobject.h
    11611157
    1162 getmtime.obj: pyconfig.h
    1163 
    11641158getplatform.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
    11651159         pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
  • python/vendor/current/PC/os2vacpp/python.def

    r2 r388  
    77               ; Data
    88               PyCFunction_Type
     9               PyCapsule_Type
    910               PyCObject_Type
    1011               PyClass_Type
     
    7677               _Py_ZeroStruct
    7778               _Py_abstract_hack
     79               _Py_capsule_hack
    7880               _Py_cobject_hack
    7981               _Py_re_syntax
     
    9092               PyCFunction_GetSelf
    9193               PyCFunction_New
     94               PyCapsule_GetContext
     95               PyCapsule_GetDestructor
     96               PyCapsule_GetName
     97               PyCapsule_GetPointer
     98               PyCapsule_Import
     99               PyCapsule_IsValid
     100               PyCapsule_New
     101               PyCapsule_SetContext
     102               PyCapsule_SetDestructor
     103               PyCapsule_SetName
     104               PyCapsule_SetPointer
    92105               PyCObject_AsVoidPtr
    93106               PyCObject_FromVoidPtrAndDesc
     
    285298               PyOS_AfterFork
    286299               PyOS_FiniInterrupts
    287                PyOS_GetLastModificationTime
    288300               PyOS_InitInterrupts
    289301               PyOS_InterruptOccurred
     
    370382               PyThreadState_New
    371383               PyThreadState_Swap
    372                PyThread__exit_thread
    373384               PyThread_acquire_lock
    374385               PyThread_allocate_lock
Note: See TracChangeset for help on using the changeset viewer.