From 2ece1f977bb53217adbb83948ecfeec75db7cf4b Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Thu, 3 Oct 2013 01:05:01 -0400 Subject: snapshot of project "lynx", label v2-8-8dev_16j --- src/LYShowInfo.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'src/LYShowInfo.c') diff --git a/src/LYShowInfo.c b/src/LYShowInfo.c index ef20791f..3bf64bd1 100644 --- a/src/LYShowInfo.c +++ b/src/LYShowInfo.c @@ -1,4 +1,4 @@ -/* $LynxId: LYShowInfo.c,v 1.73 2013/01/04 01:20:17 tom Exp $ */ +/* $LynxId: LYShowInfo.c,v 1.76 2013/10/03 01:01:34 tom Exp $ */ #include #include #include @@ -106,6 +106,25 @@ static void dt_Number(FILE *fp0, FREE(buffer); } +static void dt_URL(FILE *fp0, const char *address) +{ + ADD_SS(gettext("URL:"), address); + + /* + * If the display handles UTF-8, and if the address uses %xy formatted + * characters, show the decoded URL on the next line. + */ + if (LYCharSet_UC[current_char_set].enc == UCT_ENC_UTF8) { + char *working = 0; + + StrAllocCopy(working, address); + if (strcmp(HTUnEscape(working), address)) { + fprintf(fp0, "\n
%s\n", working); + } + free(working); + } +} + /* * LYShowInfo prints a page of info about the current file and the link that * the cursor is on. @@ -180,7 +199,7 @@ int LYShowInfo(DocInfo *doc, ADD_SS(gettext("Name:"), temp); FREE(temp); - ADD_SS(gettext("URL:"), doc->address); + dt_URL(fp0, doc->address); END_DL(); @@ -321,7 +340,7 @@ int LYShowInfo(DocInfo *doc, ADD_SS(gettext("Linkname:"), temp); FREE(temp); - ADD_SS("URL:", doc->address); + dt_URL(fp0, doc->address); if (HTLoadedDocumentCharset()) { ADD_SS(gettext("Charset:"), @@ -449,8 +468,7 @@ int LYShowInfo(DocInfo *doc, LYEntifyTitle(&buffer, gettext("(Form field)"))); } } else { - ADD_SS("URL:", - NonNull(links[doc->link].lname)); + dt_URL(fp0, NonNull(links[doc->link].lname)); } END_DL(); -- cgit 1.4.1-2-gfad0