From 228e3a7915d5c5b45a85c60e2e5b2b3d29666a39 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Tue, 17 Jun 2003 18:02:41 +0000 Subject: [w3m-dev 03914] a fragment in the Referer URI * url.c (otherinfo): strip URI fragment From: ABE Yuji --- url.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'url.c') diff --git a/url.c b/url.c index d12f83b..8386179 100644 --- a/url.c +++ b/url.c @@ -1,4 +1,4 @@ -/* $Id: url.c,v 1.79 2003/05/10 18:20:29 ukai Exp $ */ +/* $Id: url.c,v 1.80 2003/06/17 18:02:41 ukai Exp $ */ #include "fm.h" #include #include @@ -1279,13 +1279,20 @@ otherinfo(ParsedURL *target, ParsedURL *current, char *referer) if (referer == NULL && current && current->scheme != SCM_LOCAL && (current->scheme != SCM_FTP || (current->user == NULL && current->pass == NULL))) { + char *p = current->label; Strcat_charp(s, "Referer: "); + current->label = NULL; Strcat(s, parsedURL2Str(current)); + current->label = p; Strcat_charp(s, "\r\n"); } else if (referer != NULL && referer != NO_REFERER) { + char *p = strchr(referer, '#'); Strcat_charp(s, "Referer: "); - Strcat_charp(s, referer); + if (p) + Strcat_charp_n(s, referer, p - referer); + else + Strcat_charp(s, referer); Strcat_charp(s, "\r\n"); } } -- cgit v1.2.3