summaryrefslogtreecommitdiff
path: root/source/fitz/time.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-12-12 13:09:44 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-12-12 13:40:40 +0100
commite3180169b42481fbbc4886db741782ca1391c46e (patch)
treeb6f480824b68227b203ebea212bc65979fc5c7d1 /source/fitz/time.c
parent88a781b38dc63c02b69c96ef34dc8d6e699de059 (diff)
downloadmupdf-e3180169b42481fbbc4886db741782ca1391c46e.tar.xz
Add fz_remove to cope with utf-8 file names on windows.
Diffstat (limited to 'source/fitz/time.c')
-rw-r--r--source/fitz/time.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/fitz/time.c b/source/fitz/time.c
index 1f45e665..82805556 100644
--- a/source/fitz/time.c
+++ b/source/fitz/time.c
@@ -105,6 +105,25 @@ fz_fopen_utf8(const char *name, const char *mode)
return file;
}
+int
+fz_remove_utf8(const char *name)
+{
+ wchar_t *wname;
+ int n;
+
+ wname = fz_wchar_from_utf8(name);
+ if (wname == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+
+ n = _wremove(wname);
+
+ free(wname);
+ return n;
+}
+
char **
fz_argv_from_wargv(int argc, wchar_t **wargv)
{