diff options
-rw-r--r-- | CHANGES | 6 | ||||
-rw-r--r-- | src/LYShowInfo.c | 28 | ||||
-rw-r--r-- | src/LYStrings.c | 4 |
3 files changed, 30 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES index 0083ef00..6c75ae7a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,13 @@ --- $LynxId: CHANGES,v 1.665 2013/10/02 23:30:51 tom Exp $ +-- $LynxId: CHANGES,v 1.666 2013/10/03 01:05:01 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== 2013-10-02 (2.8.8dev.17) +* modify the INFO page, normally bound to "=", to show decoded strings for + URLs, e.g., which use %xy hexadecimal encoding. The decoded strings are + shown on the line following the encoded URLs if the strings are different + (Debian #398274) -TD * simplify file-URLs shown in reference list of -dump by trimming unnecessary "localhost", e.g., file://localhost/XXX 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(); diff --git a/src/LYStrings.c b/src/LYStrings.c index ae8326eb..ac5405c3 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -1,4 +1,4 @@ -/* $LynxId: LYStrings.c,v 1.214 2013/05/28 23:38:17 tom Exp $ */ +/* $LynxId: LYStrings.c,v 1.215 2013/10/02 23:58:20 tom Exp $ */ #include <HTUtils.h> #include <HTCJK.h> #include <UCAux.h> @@ -6170,7 +6170,7 @@ int LYReadCmdKey(int mode) switch ((unsigned) (tmp - src)) { case 4: if (!strncasecomp(src, "exit", 4)) - exit_immediately(0); + exit_immediately(EXIT_SUCCESS); break; case 3: if (!strncasecomp(src, "key", 3)) { |