PERFORCE change 108721 for review
Paolo Pisati
piso at FreeBSD.org
Mon Oct 30 10:13:07 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=108721
Change 108721 by piso at 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);
More information about the p4-projects
mailing list