Subject: Re: links-gui eat whitespace at end of pasted URL patch
To: None <tech-pkg@netbsd.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: tech-pkg
Date: 12/02/2004 21:06:34
--da4uJneut+ArUgXk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Dec 02, 2004 at 01:36:37PM +0100, Thomas Klausner wrote:
> On Wed, Dec 01, 2004 at 04:09:03PM +0100, Ignatios Souvatzis wrote:
> > the enclosed patch will eat up surrounding whitespace in pasted
> > URLs ... should this become official?
>
> The second part looks wrong; p should start from the right
> end of the string and work backwards. Spaces inside a URL
> are ok AFAIK (though they should be quoted before being
> sent to the web server).

corrected patch:


$NetBSD$

--- session.c.orig	Thu Dec  2 16:09:48 2004
+++ session.c	Thu Dec  2 16:37:33 2004
@@ -1948,6 +1948,16 @@
 /* this doesn't send referer */
 void goto_url(struct session *ses, unsigned char *url)
 {
+	unsigned char *p;
+
+	while (*url && isspace(*url)) {
+		url++;
+	}
+	p =3D url + strlen(url);
+	while (isspace(*--p)) {
+		*p =3D 0;
+	}
+=09
 	goto_url_f(ses, NULL, url, NULL, NULL, -1, 0, 1, 0);
 }
=20

I've also sent it to brain@artax.karlin.mff.cuni.cz... lets see what
they say.

	-is

--da4uJneut+ArUgXk
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFBr3XKN4tiz3B8hB0RApATAJ9iDeUc1C+6/YImppRZFA0H1Fyd5wCfcvDi
eECVjPG8+dBgP4dVIANua6M=
=SlDZ
-----END PGP SIGNATURE-----

--da4uJneut+ArUgXk--