src/filesystem/cocoa/SDL_sysfilesystem.m
changeset 7866 42da269b7977
parent 7771 4434498bf4b9
child 7883 62f562a475e1
equal deleted inserted replaced
7865:f2a42ca4ddf0 7866:42da269b7977
    43     char *retval = NULL;
    43     char *retval = NULL;
    44     if (baseType == NULL) {
    44     if (baseType == NULL) {
    45         baseType = "resource";
    45         baseType = "resource";
    46     }
    46     }
    47     if (SDL_strcasecmp(baseType, "bundle")==0) {
    47     if (SDL_strcasecmp(baseType, "bundle")==0) {
    48         base = [[bundle bundlePath] UTF8String];
    48         base = [[bundle bundlePath] fileSystemRepresentation];
    49     } else if (SDL_strcasecmp(baseType, "parent")==0) {
    49     } else if (SDL_strcasecmp(baseType, "parent")==0) {
    50         base = [[[bundle bundlePath] stringByDeletingLastPathComponent] UTF8String];
    50         base = [[[bundle bundlePath] stringByDeletingLastPathComponent] fileSystemRepresentation];
    51     } else {
    51     } else {
    52         /* this returns the exedir for non-bundled  and the resourceDir for bundled apps */
    52         /* this returns the exedir for non-bundled  and the resourceDir for bundled apps */
    53         base = [[bundle resourcePath] UTF8String];
    53         base = [[bundle resourcePath] fileSystemRepresentation];
    54     }
    54     }
    55     if (base) {
    55     if (base) {
    56         const size_t len = SDL_strlen(base) + 2;
    56         const size_t len = SDL_strlen(base) + 2;
    57         retval = (char *) SDL_malloc(len);
    57         retval = (char *) SDL_malloc(len);
    58         if (retval == NULL) {
    58         if (retval == NULL) {
    75 
    75 
    76     (void) org;  /* unused on Mac OS X and iOS. */
    76     (void) org;  /* unused on Mac OS X and iOS. */
    77 
    77 
    78     if ([array count] > 0) {  /* we only want the first item in the list. */
    78     if ([array count] > 0) {  /* we only want the first item in the list. */
    79         NSString *str = [array objectAtIndex:0];
    79         NSString *str = [array objectAtIndex:0];
    80         const char *base = [str UTF8String];
    80         const char *base = [str fileSystemRepresentation];
    81         if (base) {
    81         if (base) {
    82             const size_t len = SDL_strlen(base) + SDL_strlen(app) + 3;
    82             const size_t len = SDL_strlen(base) + SDL_strlen(app) + 3;
    83             retval = (char *) SDL_malloc(len);
    83             retval = (char *) SDL_malloc(len);
    84             if (retval == NULL) {
    84             if (retval == NULL) {
    85                 SDL_OutOfMemory();
    85                 SDL_OutOfMemory();