FreeBSD/sbin/atm/atmconfig/main.c
/*
 * Get next line from a help file
 */
Get next line from a help file
Get next line from a help file
static const char *
help_next_line(struct help_file *hp)
{
	for (;;) {
		if (hp->fp != NULL) {
			if (fgets(hp->line, sizeof(hp->line), hp->fp) != NULL)
				return (hp->line);
			if (ferror(hp->fp))
				err(1, "%s", hp->fname);
			free(hp->fname);
			fclose(hp->fp);
			hp->fp = NULL;
		}
		if (help_next_file(hp) == -1)
			return (NULL);
	}
}
static const char * help_next_line ( struct help_file * hp ) { for ( ; ; ) { if ( hp -> fp != NULL ) { if ( fgets ( hp -> line , sizeof ( hp -> line ) , hp -> fp ) != NULL ) return ( hp -> line ) ; if ( ferror ( hp -> fp ) ) err ( 1 , " " , hp -> fname ) ; free ( hp -> fname ) ; fclose ( hp -> fp ) ; hp -> fp = NULL ; } if ( help_next_file ( hp ) == -1 ) return ( NULL ) ; } }
Get next line from a help file
Get next line from a help file