summaryrefslogtreecommitdiff
path: root/apps/x11_main.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-04-20 16:00:13 +0200
committerRobin Watts <robin.watts@artifex.com>2012-04-20 16:10:02 +0100
commitc6e27a74283a1fa31a930f1909dbc46e131f0447 (patch)
treeb0104b5dd19f07fec8d2c03720c3efc8a8f60166 /apps/x11_main.c
parent9fbd2de7411f6c87c6f1ad0d9adfba9fe5164e0f (diff)
downloadmupdf-c6e27a74283a1fa31a930f1909dbc46e131f0447.tar.xz
Pass UTF8 filename to fz_open_document / fz_open_file to remove kludges.
Use _wopen on a UTF8 -> wchar_t decoded filename to support UTF8 filenames for win32.
Diffstat (limited to 'apps/x11_main.c')
-rw-r--r--apps/x11_main.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/apps/x11_main.c b/apps/x11_main.c
index b62f97db..6ab5b43a 100644
--- a/apps/x11_main.c
+++ b/apps/x11_main.c
@@ -532,15 +532,8 @@ void onselreq(Window requestor, Atom selection, Atom target, Atom property, Time
void winreloadfile(pdfapp_t *app)
{
- int fd;
-
pdfapp_close(app);
-
- fd = open(filename, O_RDONLY, 0666);
- if (fd < 0)
- fz_throw(gapp.ctx, "cannot reload file '%s'", filename);
-
- pdfapp_open(app, filename, fd, 1);
+ pdfapp_open(app, filename, 1);
}
void winopenuri(pdfapp_t *app, char *buf)
@@ -612,7 +605,6 @@ int main(int argc, char **argv)
int oldy = 0;
int resolution = -1;
int pageno = 1;
- int fd;
fd_set fds;
int width = -1;
int height = -1;
@@ -663,11 +655,7 @@ int main(int argc, char **argv)
gapp.resolution = resolution;
gapp.pageno = pageno;
- fd = open(filename, O_RDONLY, 0666);
- if (fd < 0)
- fz_throw(gapp.ctx, "cannot open file '%s'", filename);
-
- pdfapp_open(&gapp, filename, fd, 0);
+ pdfapp_open(&gapp, filename, 0);
FD_ZERO(&fds);