common.c (31492) | common.c (39084) |
---|---|
1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 27 unchanged lines hidden (view full) --- 36 * SUCH DAMAGE. 37 */ 38 39#ifndef lint 40/* 41static char sccsid[] = "@(#)common.c 8.5 (Berkeley) 4/28/95"; 42*/ 43static const char rcsid[] = | 1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 27 unchanged lines hidden (view full) --- 36 * SUCH DAMAGE. 37 */ 38 39#ifndef lint 40/* 41static char sccsid[] = "@(#)common.c 8.5 (Berkeley) 4/28/95"; 42*/ 43static const char rcsid[] = |
44 "$Id$"; | 44 "$Id: common.c,v 1.10 1997/12/02 20:45:18 wollman Exp $"; |
45#endif /* not lint */ 46 47#include <sys/param.h> 48#include <sys/stat.h> 49#include <sys/time.h> 50 51#include <dirent.h> 52#include <stdio.h> --- 21 unchanged lines hidden (view full) --- 74 * Returns 0 at EOF or the number of characters read. 75 */ 76int 77getline(cfp) 78 FILE *cfp; 79{ 80 register int linel = 0; 81 register char *lp = line; | 45#endif /* not lint */ 46 47#include <sys/param.h> 48#include <sys/stat.h> 49#include <sys/time.h> 50 51#include <dirent.h> 52#include <stdio.h> --- 21 unchanged lines hidden (view full) --- 74 * Returns 0 at EOF or the number of characters read. 75 */ 76int 77getline(cfp) 78 FILE *cfp; 79{ 80 register int linel = 0; 81 register char *lp = line; |
82 register c; | 82 register int c; |
83 84 while ((c = getc(cfp)) != '\n' && linel+1 < sizeof(line)) { 85 if (c == EOF) 86 return(0); 87 if (c == '\t') { 88 do { 89 *lp++ = ' '; 90 linel++; --- 202 unchanged lines hidden --- | 83 84 while ((c = getc(cfp)) != '\n' && linel+1 < sizeof(line)) { 85 if (c == EOF) 86 return(0); 87 if (c == '\t') { 88 do { 89 *lp++ = ' '; 90 linel++; --- 202 unchanged lines hidden --- |