From 841952db71d6541a2e98fd4d1d49dede284b2cf8 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 24 May 2016 01:04:03 +0100 Subject: Fix -p password option for MuPDF on Windows. --- platform/x11/win_main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'platform/x11/win_main.c') 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); -- cgit v1.2.3