Changeset 427 for cpp/common


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

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

Location:
cpp/common
Files:
2 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);
  • cpp/common/virtfile/virtfile.h

    r410 r427  
    8686public:
    8787        virtual ~VirtDIR() {}
    88         virtual dirent* Vreaddir() { return 0; }
     88        virtual dirent* Vreaddir() { return NULL; }
    8989};
    9090
Note: See TracChangeset for help on using the changeset viewer.