systems.c (31918) | systems.c (31962) |
---|---|
1/* 2 * System configuration routines 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * | 1/* 2 * System configuration routines 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * |
20 * $Id: systems.c,v 1.32 1997/12/21 02:11:48 brian Exp $ | 20 * $Id: systems.c,v 1.33 1997/12/21 03:41:23 brian Exp $ |
21 * 22 * TODO: 23 */ 24#include <sys/param.h> 25#include <netinet/in.h> 26 27#include <ctype.h> 28#include <pwd.h> --- 216 unchanged lines hidden (view full) --- 245 fp = ID0fopen(filename, "r"); 246 if (fp == NULL) { 247 LogPrintf(LogDEBUG, "ReadSystem: Can't open %s.\n", filename); 248 return (-1); 249 } 250 LogPrintf(LogDEBUG, "ReadSystem: Checking %s (%s).\n", name, filename); 251 252 linenum = 0; | 21 * 22 * TODO: 23 */ 24#include <sys/param.h> 25#include <netinet/in.h> 26 27#include <ctype.h> 28#include <pwd.h> --- 216 unchanged lines hidden (view full) --- 245 fp = ID0fopen(filename, "r"); 246 if (fp == NULL) { 247 LogPrintf(LogDEBUG, "ReadSystem: Can't open %s.\n", filename); 248 return (-1); 249 } 250 LogPrintf(LogDEBUG, "ReadSystem: Checking %s (%s).\n", name, filename); 251 252 linenum = 0; |
253 while (fgets(line, sizeof(line), fp)) { | 253 while (fgets(line, sizeof line, fp)) { |
254 linenum++; 255 cp = line; 256 switch (*cp) { 257 case '#': /* comment */ 258 break; 259 case ' ': 260 case '\t': 261 break; --- 16 unchanged lines hidden (view full) --- 278 if (!n) 279 return 0; /* got it */ 280 break; 281 default: 282 LogPrintf(LogWARN, "%s: %s: Invalid command\n", filename, cp); 283 break; 284 } 285 } else if (strcmp(cp, name) == 0) { | 254 linenum++; 255 cp = line; 256 switch (*cp) { 257 case '#': /* comment */ 258 break; 259 case ' ': 260 case '\t': 261 break; --- 16 unchanged lines hidden (view full) --- 278 if (!n) 279 return 0; /* got it */ 280 break; 281 default: 282 LogPrintf(LogWARN, "%s: %s: Invalid command\n", filename, cp); 283 break; 284 } 285 } else if (strcmp(cp, name) == 0) { |
286 while (fgets(line, sizeof(line), fp)) { | 286 while (fgets(line, sizeof line, fp)) { |
287 cp = line; 288 if (issep(*cp)) { 289 n = strspn(cp, " \t"); 290 cp += n; 291 len = strlen(cp); 292 if (!len || *cp == '#') 293 continue; 294 if (cp[len-1] == '\n') --- 74 unchanged lines hidden --- | 287 cp = line; 288 if (issep(*cp)) { 289 n = strspn(cp, " \t"); 290 cp += n; 291 len = strlen(cp); 292 if (!len || *cp == '#') 293 continue; 294 if (cp[len-1] == '\n') --- 74 unchanged lines hidden --- |