diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-05-24 01:04:03 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-05-24 10:24:52 +0100 |
commit | 841952db71d6541a2e98fd4d1d49dede284b2cf8 (patch) | |
tree | d1679a02e684b2bdf7e76d7abab5e4f1efe179c1 /platform | |
parent | a0a9ce485579352ce9c3c4568c07e56b7029a8c8 (diff) | |
download | mupdf-841952db71d6541a2e98fd4d1d49dede284b2cf8.tar.xz |
Fix -p password option for MuPDF on Windows.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/x11/win_main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/platform/x11/win_main.c b/platform/x11/win_main.c index 1ca09c21..f1731954 100644 --- a/platform/x11/win_main.c +++ b/platform/x11/win_main.c @@ -31,6 +31,7 @@ static HCURSOR arrowcurs, handcurs, waitcurs, caretcurs; static LRESULT CALLBACK frameproc(HWND, UINT, WPARAM, LPARAM); static LRESULT CALLBACK viewproc(HWND, UINT, WPARAM, LPARAM); static int timer_pending = 0; +static char *password = NULL; static int justcopied = 0; @@ -405,6 +406,14 @@ char *winpassword(pdfapp_t *app, char *filename) { char buf[1024], *s; int code; + + if (password) + { + char *p = password; + password = NULL; + return p; + } + strcpy(buf, filename); s = buf; if (strrchr(s, '\\')) s = strrchr(s, '\\') + 1; @@ -1221,7 +1230,6 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShow int bps = 0; int displayRes = get_system_dpi(); int c; - char *password = NULL; char *layout_css = NULL; ctx = fz_new_context(NULL, NULL, FZ_STORE_DEFAULT); |