Ignore:
Timestamp:
08/27/15 00:07:42 (10 years ago)
Author:
Maciej Komosinski
Message:

Android can read files again after a slash has been removed from the path

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/nonstd_stdio.cpp

    r375 r427  
    243243#ifdef __ANDROID__
    244244#include "log.h"
    245 #include "nonstd.h"
     245#include "dirs.h"
    246246#include "nonstd_stl.h"
    247247MFILE *mfopen(const char *path, const char *mode)
     
    250250        //log_printf("Opening '%s', mode='%s'",path,mode);
    251251        //log_printf("getAppResourcesDir()='%s'",respath.c_str());
     252        //log_printf("getAppWritableDir()='%s'",getAppWritableDir().c_str());
    252253        NvFile *rfile=NULL; //can only read
    253254        FILE *rwfile=NULL;
     
    255256        {
    256257                path+=respath.length(); //strip the prefix, we need a relative path in assets
     258                if (path[0]=='/') path++; //also strip slash if it was there (the prefix has no trailing slash so it doesn't get stipped above)
    257259                if (strstr(mode,"w"))
    258260                        log_printf("Warning: attempt to open a read-only resource '%s' in writable mode '%s'",path,mode);
Note: See TracChangeset for help on using the changeset viewer.