[hackers] [PATCH] Honor SURF_USERAGENT evironment variable

From: Vasily Kolobkov <polezaivsani_AT_openmailbox.org>
Date: Sat, 13 May 2017 12:00:22 +0200

From: Vasily Kolobkov <>

---
 surf.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/surf.c b/surf.c
index 2d3a6f5..b90acaa 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -276,14 +276,15 @@ die(const char *errstr, ...)
 }
 
 void
 setup(void)
 {
 	GdkDisplay *gdpy;
 	int i, j;
+	char *envuseragent;
 
 	/* clean up any zombies immediately */
 	sigchld(0);
 	if (signal(SIGHUP, sighup) == SIG_ERR)
 		die("Can't install SIGHUP handler");
 
 	if (!(dpy = XOpenDisplay(NULL)))
_AT_@ -349,14 +350,17 @@ setup(void)
 			}
 		} else {
 			fprintf(stderr, "Could not compile regex: %s\n",
 			        uriparams[i].uri);
 			uriparams[i].uri = NULL;
 		}
 	}
+
+	if ((envuseragent = getenv("SURF_USERAGENT")))
+		fulluseragent = envuseragent;
 }
 
 void
 sigchld(int unused)
 {
 	if (signal(SIGCHLD, sigchld) == SIG_ERR)
 		die("Can't install SIGCHLD handler");
-- 
2.12.2
Received on Sat May 13 2017 - 12:00:22 CEST

This archive was generated by hypermail 2.3.0 : Sat May 13 2017 - 12:12:19 CEST