diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index da7173de30..2a3bf69dfb 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -851,13 +851,9 @@ char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks) t++; } else if (next - p == 1 && p[0] == '.') - { p += 2; - } else if (next - p == 0) - { p += 1; - } else { /* fail when truncating */ diff --git a/libretro-common/file/nbio/nbio_linux.c b/libretro-common/file/nbio/nbio_linux.c index c454440cd8..70e3a98c80 100644 --- a/libretro-common/file/nbio/nbio_linux.c +++ b/libretro-common/file/nbio/nbio_linux.c @@ -92,10 +92,7 @@ static void nbio_begin_op(struct nbio_linux_t* handle, uint16_t op) handle->cb.aio_nbytes = handle->len; if (io_submit(handle->ctx, 1, &cbp) != 1) - { - puts("ERROR - io_submit() failed"); abort(); - } handle->busy = true; } @@ -160,21 +157,16 @@ static void nbio_linux_resize(void *data, size_t len) if (!handle) return; + /* This works perfectly fine if this check is removed, but it + * won't work on other nbio implementations */ + /* therefore, it's blocked so nobody accidentally relies on it */ if (len < handle->len) - { - /* this works perfectly fine if this check is removed, but it - * won't work on other nbio implementations */ - /* therefore, it's blocked so nobody accidentally relies on it */ - puts("ERROR - attempted file shrink operation, not implemented"); abort(); - } if (ftruncate(handle->fd, len) != 0) - { - puts("ERROR - couldn't resize file (ftruncate)"); abort(); /* this one returns void and I can't find any other way for it to report failure */ - } + handle->ptr = realloc(handle->ptr, len); handle->len = len; } diff --git a/libretro-common/file/nbio/nbio_stdio.c b/libretro-common/file/nbio/nbio_stdio.c index 52e8eee5eb..9bacacb5a0 100644 --- a/libretro-common/file/nbio/nbio_stdio.c +++ b/libretro-common/file/nbio/nbio_stdio.c @@ -121,10 +121,7 @@ static void nbio_stdio_begin_read(void *data) return; if (handle->op >= 0) - { - puts("ERROR - attempted file read operation while busy"); abort(); - } fseek(handle->f, 0, SEEK_SET); @@ -139,10 +136,7 @@ static void nbio_stdio_begin_write(void *data) return; if (handle->op >= 0) - { - puts("ERROR - attempted file write operation while busy"); abort(); - } fseek(handle->f, 0, SEEK_SET); handle->op = NBIO_WRITE; @@ -200,15 +194,9 @@ static void nbio_stdio_resize(void *data, size_t len) return; if (handle->op >= 0) - { - puts("ERROR - attempted file resize operation while busy"); abort(); - } if (len < handle->len) - { - puts("ERROR - attempted file shrink operation, not implemented"); abort(); - } handle->len = len; handle->progress = len; @@ -248,10 +236,7 @@ static void nbio_stdio_free(void *data) if (!handle) return; if (handle->op >= 0) - { - puts("ERROR - attempted free() while busy"); abort(); - } fclose(handle->f); free(handle->data); diff --git a/libretro-common/file/nbio/nbio_unixmmap.c b/libretro-common/file/nbio/nbio_unixmmap.c index 29b574738d..8be3a0ea4e 100644 --- a/libretro-common/file/nbio/nbio_unixmmap.c +++ b/libretro-common/file/nbio/nbio_unixmmap.c @@ -116,16 +116,12 @@ static void nbio_mmap_unix_resize(void *data, size_t len) /* this works perfectly fine if this check is removed, but it * won't work on other nbio implementations */ /* therefore, it's blocked so nobody accidentally relies on it */ - puts("ERROR - attempted file shrink operation, not implemented"); abort(); } if (ftruncate(handle->fd, len) != 0) - { - puts("ERROR - couldn't resize file (ftruncate)"); abort(); /* this one returns void and I can't find any other way for it to report failure */ - } munmap(handle->ptr, handle->len); @@ -133,10 +129,7 @@ static void nbio_mmap_unix_resize(void *data, size_t len) handle->len = len; if (handle->ptr == MAP_FAILED) - { - puts("ERROR - couldn't resize file (mmap)"); abort(); - } } static void *nbio_mmap_unix_get_ptr(void *data, size_t* len) diff --git a/libretro-common/file/nbio/nbio_windowsmmap.c b/libretro-common/file/nbio/nbio_windowsmmap.c index cac7194f25..067aca745e 100644 --- a/libretro-common/file/nbio/nbio_windowsmmap.c +++ b/libretro-common/file/nbio/nbio_windowsmmap.c @@ -144,7 +144,6 @@ static void nbio_mmap_win32_resize(void *data, size_t len) * but it won't work on other nbio implementations */ /* therefore, it's blocked so nobody accidentally * relies on it. */ - puts("ERROR - attempted file shrink operation, not implemented"); abort(); } @@ -158,10 +157,7 @@ static void nbio_mmap_win32_resize(void *data, size_t len) #endif if (!SetEndOfFile(handle->file)) - { - puts("ERROR - couldn't resize file (SetEndOfFile)"); abort(); /* this one returns void and I can't find any other way for it to report failure */ - } handle->len = len; UnmapViewOfFile(handle->ptr); @@ -170,10 +166,7 @@ static void nbio_mmap_win32_resize(void *data, size_t len) CloseHandle(mem); if (!handle->ptr) - { - puts("ERROR - couldn't resize file (MapViewOfFile)"); abort(); - } } static void *nbio_mmap_win32_get_ptr(void *data, size_t* len)