Fix ``if`` breaking the path

This commit is contained in:
me-no-dev 2017-01-31 17:43:22 +02:00
parent 84590ec0a4
commit a57b6326e3

View File

@ -250,11 +250,9 @@ static void file_cleanup(vfs_fat_ctx_t* ctx, int fd)
} }
#define vfs_fat_fix_path(ctx, path) \ #define vfs_fat_fix_path(ctx, path) \
if (((vfs_fat_ctx_t*)ctx)->fat_drive[0]) { \ char buf_ ## path[strlen(path)+strlen(((vfs_fat_ctx_t*)ctx)->fat_drive)+1]; \
char buf_ ## path[strlen(path)+strlen(((vfs_fat_ctx_t*)ctx)->fat_drive)+1]; \ sprintf(buf_ ## path,"%s%s", ((vfs_fat_ctx_t*)ctx)->fat_drive, path); \
sprintf(buf_ ## path,"%s%s", ((vfs_fat_ctx_t*)ctx)->fat_drive, path); \ path = (const char *)buf_ ## path;
path = (const char *)buf_ ## path; \
}
static int vfs_fat_open(void* ctx, const char * path, int flags, int mode) static int vfs_fat_open(void* ctx, const char * path, int flags, int mode)
{ {