Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Oct 2006 10:13:05 GMT
From:      Paolo Pisati <piso@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 108721 for review
Message-ID:  <200610301013.k9UAD5RH089152@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=108721

Change 108721 by piso@piso_newluxor on 2006/10/30 10:12:11

	Treat lines starting with '#' as comments.

Affected files ...

.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#17 edit

Differences ...

==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#17 (text+ko) ====

@@ -119,6 +119,7 @@
 #include <sys/types.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <ctype.h>
 #include <dlfcn.h>
 #include <errno.h>
 #include <string.h>
@@ -1494,7 +1495,7 @@
 {
 	char buf[256], conf[] = "/etc/libalias.conf";
 	FILE *fd;
-	int len;
+	int i, len;
 
 	fd = fopen(conf, "r");
 	if (fd == NULL)
@@ -1508,6 +1509,11 @@
 		        break;
 		len = strlen(buf);
 		if (len > 1) {
+			for (i=0; i<len; i++)
+				if (!isspace(buf[i]))
+					break;
+			if (buf[i] == '#')
+				continue;
 			buf[len - 1] = '\0';
 			printf("Loading %s\n", buf);
 			LibAliasLoadModule(buf);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610301013.k9UAD5RH089152>