commit fb00d025f64e89ab4951bb67a3168964e3edb9fb
parent ab35ad8640e13d76d78e6713188bf7d6849d385d
Author: ukai <ukai>
Date:   Tue, 17 Jun 2003 18:02:41 +0000
[w3m-dev 03914] a fragment in the Referer URI
* url.c (otherinfo): strip URI fragment
From: ABE Yuji <cbo46560@pop12.odn.ne.jp>
Diffstat:
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-18  ABE Yuji <cbo46560@pop12.odn.ne.jp>
+
+	* [w3m-dev 03914] a fragment in the Referer URI
+	* url.c (otherinfo): strip URI fragment
+
 2003-06-13  Hiroyuki Ito <hito@crl.go.jp>
 
 	* [w3m-dev 03913] fix gif animation support
diff --git a/url.c b/url.c
@@ -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");
 	}
     }