diff --git a/OLVASSEL.md b/OLVASSEL.md index 8436f22..97411a6 100644 --- a/OLVASSEL.md +++ b/OLVASSEL.md @@ -191,6 +191,7 @@ A `name` környezeti változó beállítása `len` hosszú `data` értékkel. Si | Funkció | Leírás | |---------------|----------------------------------------------------------------------------| +| remove | megszokott, de széles karakterű sztringet is elfogadhat | | fopen | megszokott, de széles karakterű sztringet is elfogadhat, mode esetén is | | fclose | megszokott | | fflush | megszokott | diff --git a/README.md b/README.md index b96a32b..91c6146 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,7 @@ Sets an environment variable by `name` with `data` of length `len`. On success r | Function | Description | |---------------|----------------------------------------------------------------------------| +| remove | as usual, but might accept wide char strings | | fopen | as usual, but might accept wide char strings, also for mode | | fclose | as usual | | fflush | as usual | diff --git a/uefi/stdio.c b/uefi/stdio.c index 13d1940..6df1c6c 100644 --- a/uefi/stdio.c +++ b/uefi/stdio.c @@ -155,6 +155,8 @@ int __remove (const char_t *__filename, int isdir) uintn_t fsiz = (uintn_t)sizeof(efi_file_info_t), i; /* little hack to support read and write mode for Delete() without create mode */ FILE *f = fopen(__filename, CL("@")); + if(errno) + return 1; if(!f || f == stdin || f == stdout || f == stderr || (__ser && f == (FILE*)__ser)) { errno = EBADF; return 1; @@ -204,6 +206,7 @@ FILE *fopen (const char_t *__filename, const char_t *__modes) #ifndef UEFI_NO_UTF8 wchar_t wcname[BUFSIZ]; #endif + errno = 0; if(!__filename || !*__filename || !__modes || !*__modes) { errno = EINVAL; return NULL; @@ -269,7 +272,6 @@ FILE *fopen (const char_t *__filename, const char_t *__modes) errno = ENODEV; return NULL; } - errno = 0; ret = (FILE*)malloc(sizeof(FILE)); if(!ret) return NULL; /* normally write means read,write,create. But for remove (internal '@' mode), we need read,write without create */