aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/main.c b/main.c
index 4eba103..fb2142e 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.262 2010/07/19 12:08:41 htrb Exp $ */
+/* $Id: main.c,v 1.263 2010/07/19 23:34:01 htrb Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -1282,8 +1282,25 @@ do_dump(Buffer *buf)
dump_head(buf);
if (w3m_dump & DUMP_SOURCE)
dump_source(buf);
- if (w3m_dump == DUMP_BUFFER)
+ if (w3m_dump == DUMP_BUFFER) {
+ int i;
saveBuffer(buf, stdout, FALSE);
+ if (displayLinkNumber && buf->href) {
+ printf("\nReferences:\n\n");
+ for (i = 0; i < buf->href->nanchor; i++) {
+ ParsedURL pu;
+ static Str s = NULL;
+ if (buf->href->anchors[i].slave)
+ continue;
+ parseURL2(buf->href->anchors[i].url, &pu, baseURL(buf));
+ s = parsedURL2Str(&pu);
+ if (DecodeURL)
+ s = Strnew_charp(url_unquote_conv
+ (s->ptr, Currentbuf->document_charset));
+ printf("[%d] %s\n", buf->href->anchors[i].hseq + 1, s->ptr);
+ }
+ }
+ }
mySignal(SIGINT, prevtrap);
}