src/file/SDL_rwops.c
changeset 1978 542c78b6fb12
parent 1895 c121d94672cb
child 2159 dd4753e47ed4
     1.1 --- a/src/file/SDL_rwops.c	Thu Aug 10 14:35:42 2006 +0000
     1.2 +++ b/src/file/SDL_rwops.c	Thu Aug 10 14:54:23 2006 +0000
     1.3 @@ -349,51 +349,6 @@
     1.4  
     1.5  /* Functions to create SDL_RWops structures from various data sources */
     1.6  
     1.7 -#ifdef __MACOS__
     1.8 -/*
     1.9 - * translate unix-style slash-separated filename to mac-style colon-separated
    1.10 - * name; return malloced string
    1.11 - */
    1.12 -static char *
    1.13 -unix_to_mac(const char *file)
    1.14 -{
    1.15 -    int flen = SDL_strlen(file);
    1.16 -    char *path = SDL_malloc(flen + 2);
    1.17 -    const char *src = file;
    1.18 -    char *dst = path;
    1.19 -    if (*src == '/') {
    1.20 -        /* really depends on filesystem layout, hope for the best */
    1.21 -        src++;
    1.22 -    } else {
    1.23 -        /* Check if this is a MacOS path to begin with */
    1.24 -        if (*src != ':')
    1.25 -            *dst++ = ':';       /* relative paths begin with ':' */
    1.26 -    }
    1.27 -    while (src < file + flen) {
    1.28 -        const char *end = SDL_strchr(src, '/');
    1.29 -        int len;
    1.30 -        if (!end)
    1.31 -            end = file + flen;  /* last component */
    1.32 -        len = end - src;
    1.33 -        if (len == 0 || (len == 1 && src[0] == '.')) {
    1.34 -            /* remove repeated slashes and . */
    1.35 -        } else {
    1.36 -            if (len == 2 && src[0] == '.' && src[1] == '.') {
    1.37 -                /* replace .. with the empty string */
    1.38 -            } else {
    1.39 -                SDL_memcpy(dst, src, len);
    1.40 -                dst += len;
    1.41 -            }
    1.42 -            if (end < file + flen)
    1.43 -                *dst++ = ':';
    1.44 -        }
    1.45 -        src = end + 1;
    1.46 -    }
    1.47 -    *dst++ = '\0';
    1.48 -    return path;
    1.49 -}
    1.50 -#endif /* __MACOS__ */
    1.51 -
    1.52  SDL_RWops *
    1.53  SDL_RWFromFile(const char *file, const char *mode)
    1.54  {
    1.55 @@ -421,15 +376,7 @@
    1.56  
    1.57  #elif HAVE_STDIO_H
    1.58  
    1.59 -#ifdef __MACOS__
    1.60 -    {
    1.61 -        char *mpath = unix_to_mac(file);
    1.62 -        fp = fopen(mpath, mode);
    1.63 -        SDL_free(mpath);
    1.64 -    }
    1.65 -#else
    1.66      fp = fopen(file, mode);
    1.67 -#endif
    1.68      if (fp == NULL) {
    1.69          SDL_SetError("Couldn't open %s", file);
    1.70      } else {