From c92c03f3716af3c32448d67688b75b922b374578 Mon Sep 17 00:00:00 2001 From: malc Date: Tue, 30 Dec 2014 01:44:22 +0300 Subject: [PATCH] -3 lines --- link.c | 7 +------ main.ml | 10 ++++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/link.c b/link.c index 3ceb795..9656252 100644 --- a/link.c +++ b/link.c @@ -595,12 +595,7 @@ static void pdfinfo (void) for (i = 0; i < sizeof (items) / sizeof (*items); ++i) { pdf_obj *obj = pdf_dict_gets (infoobj, items[i]); s = pdf_to_utf8 (state.u.pdf, obj); - if (*s) { - if (i == 0) { - printd ("title %s", s); - } - printd ("info %s\t%s", items[i], s); - } + if (*s) printd ("info %s\t%s", items[i], s); fz_free (state.ctx, s); } } diff --git a/main.ml b/main.ml index 42ce918..55898c8 100644 --- a/main.ml +++ b/main.ml @@ -1712,10 +1712,6 @@ let act cmds = if conf.maxwait = None && not !wtmode then G.postRedisplay "continue"; - | "title" :: args :: [] -> - conf.title <- args; - Wsi.settitle args - | "msg" :: args :: [] -> showtext ' ' args @@ -1936,6 +1932,12 @@ let act cmds = state.reprf <- (fun () -> gotopagexy n (float l) (float t)) | "info" :: args :: [] -> + let pos = nindex args '\t' in + if pos >= 0 && String.sub args 0 pos = "Title" + then + let s = String.sub args (pos+1) @@ String.length args - pos - 1 in + conf.title <- s; + Wsi.settitle s; state.docinfo <- (1, args) :: state.docinfo | "infoend" :: [] -> -- 2.11.4.GIT