config.c (185289) | config.c (209052) |
---|---|
1 /*- 2 * Copyright (c) 2005-2008 Daniel Braniss <danny@cs.huji.ac.il> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 * 26 */ 27/* 28 | $Id: config.c,v 2.1 2006/11/12 08:06:51 danny Exp danny $ 29 */ 30 31#include <sys/cdefs.h> | 1 /*- 2 * Copyright (c) 2005-2008 Daniel Braniss <danny@cs.huji.ac.il> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 * 26 */ 27/* 28 | $Id: config.c,v 2.1 2006/11/12 08:06:51 danny Exp danny $ 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sbin/iscontrol/config.c 185289 2008-11-25 07:17:11Z scottl $"); | 32__FBSDID("$FreeBSD: head/sbin/iscontrol/config.c 209052 2010-06-11 17:03:04Z uqs $"); |
33 34#include <stdlib.h> 35#include <unistd.h> 36#include <stdio.h> 37#include <string.h> 38#include <errno.h> 39#include <fcntl.h> 40#include <time.h> --- 203 unchanged lines hidden (view full) --- 244 len = 0; 245 state = 0; 246 while((lp = getline(fd)) != NULL) { 247 for(; isspace(*lp); lp++) 248 ; 249 switch(state) { 250 case 0: 251 if((p = strchr(lp, '{')) != NULL) { | 33 34#include <stdlib.h> 35#include <unistd.h> 36#include <stdio.h> 37#include <string.h> 38#include <errno.h> 39#include <fcntl.h> 40#include <time.h> --- 203 unchanged lines hidden (view full) --- 244 len = 0; 245 state = 0; 246 while((lp = getline(fd)) != NULL) { 247 for(; isspace(*lp); lp++) 248 ; 249 switch(state) { 250 case 0: 251 if((p = strchr(lp, '{')) != NULL) { |
252 n = 0; | |
253 while((--p > lp) && *p && isspace(*p)); 254 n = p - lp; 255 if(len && strncmp(lp, key, MAX(n, len)) == 0) 256 state = 2; 257 else 258 state = 1; 259 continue; 260 } --- 116 unchanged lines hidden --- | 252 while((--p > lp) && *p && isspace(*p)); 253 n = p - lp; 254 if(len && strncmp(lp, key, MAX(n, len)) == 0) 255 state = 2; 256 else 257 state = 1; 258 continue; 259 } --- 116 unchanged lines hidden --- |