hal/hald hald.c,1.47,1.48

David Zeuthen david at freedesktop.org
Tue Feb 7 17:31:05 PST 2006


Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv16455/hald

Modified Files:
	hald.c 
Log Message:
2006-02-07  David Zeuthen  <davidz at redhat.com>

        * hald/hald.c (main): Hald doesn't handle the case that PATH is
        not set (getenv returns NULL).  Fixed in attached patch. From
        Sjoerd Simons <sjoerd at luon.net>.



Index: hald.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- hald.c	21 Jan 2006 16:54:04 -0000	1.47
+++ hald.c	8 Feb 2006 01:31:03 -0000	1.48
@@ -382,13 +382,18 @@
 	 * run-hald.sh and friends)
 	 */
 	path = getenv ("PATH");
-	g_strlcpy (newpath, path, sizeof (newpath));
 	if (path != NULL) {
+		g_strlcpy (newpath, path, sizeof (newpath));
 		g_strlcat (newpath, ":", sizeof (newpath));
-		g_strlcat (newpath, PACKAGE_LIBEXEC_DIR, sizeof (newpath));
-		g_strlcat (newpath, ":", sizeof (newpath));
-		g_strlcat (newpath, PACKAGE_SCRIPT_DIR, sizeof (newpath));
-	}
+	} else {
+		/* No PATH was set */
+		newpath[0] = '\0';
+	} 
+
+	g_strlcat (newpath, PACKAGE_LIBEXEC_DIR, sizeof (newpath));
+	g_strlcat (newpath, ":", sizeof (newpath));
+	g_strlcat (newpath, PACKAGE_SCRIPT_DIR, sizeof (newpath));
+
 	setenv ("PATH", newpath, TRUE);
 
 	while (1) {




More information about the hal-commit mailing list