diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2013-10-03 01:05:01 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2013-10-03 01:05:01 -0400 |
commit | 2ece1f977bb53217adbb83948ecfeec75db7cf4b (patch) | |
tree | 58cb1102b9c97167c44cc92de21726890f14b635 /src/LYShowInfo.c | |
parent | 851f7f168a6385cefbb858397195163aff5ed30b (diff) | |
download | lynx-snapshots-2ece1f977bb53217adbb83948ecfeec75db7cf4b.tar.gz |
snapshot of project "lynx", label v2-8-8dev_16j
Diffstat (limited to 'src/LYShowInfo.c')
-rw-r--r-- | src/LYShowInfo.c | 28 |
1 files changed, 23 insertions, 5 deletions
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 <HTUtils.h> #include <HTFile.h> #include <HTParse.h> @@ -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<br>%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(); |