Ignore:
Timestamp:
Sep 3, 2010, 5:33:06 PM (15 years ago)
Author:
Yuri Dario
Message:

python: merged offline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/trunk/Python/import.c

    r2 r10  
    15641564#include <dirent.h>
    15651565
     1566#elif defined(__KLIBC__)
     1567#include <stdlib.h>
     1568
    15661569#elif defined(PYOS_OS2)
    15671570#define INCL_DOS
     
    16831686
    16841687/* OS/2 */
     1688#elif defined(__KLIBC__)
     1689        char canon[MAXPATHLEN+1];
     1690        size_t canonlen;
     1691        char *p, *p2;
     1692
     1693        if (Py_GETENV("PYTHONCASEOK") != NULL)
     1694                return 1;
     1695
     1696        /* This resolves case differences and return and native OS/2
     1697           path. Unfortunately, it'll also resolve symbolic links
     1698           while of course will screw up a bit... */
     1699        if (!_realrealpath(buf, canon, sizeof(canon)))
     1700                return 0;
     1701        canonlen = strlen(canon);
     1702        if (canonlen < namelen)
     1703                return 0;
     1704        p = strrchr(canon, SEP);
     1705        p2 = strrchr(p ? p : canon, ALTSEP);
     1706        if (p2)
     1707                p = p2;
     1708
     1709        return strncmp(p ? p + 1 : canon, name, namelen) == 0;
     1710
    16851711#elif defined(PYOS_OS2)
    16861712        HDIR hdir = 1;
Note: See TracChangeset for help on using the changeset viewer.