| 1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
| 9 |
|
* |
| 10 |
|
* 8/19/88 |
| 11 |
|
* |
| 12 |
< |
* printargs(ac,av,fp) print an argument list to fp, followed by '\n' |
| 12 |
> |
* printargs(ac,av,fp) print an argument list to fp, followed by '\n' |
| 13 |
|
* isformat(s) returns true if s is of the form "FORMAT=*" |
| 14 |
|
* formatval(r,s) copy the format value in s to r |
| 15 |
|
* fputformat(s,fp) write "FORMAT=%s" to fp |
| 22 |
|
#include <stdio.h> |
| 23 |
|
#include <ctype.h> |
| 24 |
|
|
| 25 |
< |
#define MAXLINE 512 |
| 25 |
> |
#define MAXLINE 512 |
| 26 |
|
|
| 27 |
|
#ifndef BSD |
| 28 |
< |
#define index strchr |
| 28 |
> |
#define index strchr |
| 29 |
|
#endif |
| 30 |
|
|
| 31 |
|
extern char *index(); |
| 97 |
|
|
| 98 |
|
for ( ; ; ) { |
| 99 |
|
buf[MAXLINE-2] = '\n'; |
| 100 |
< |
if (fgets(buf, sizeof(buf), fp) == NULL) |
| 100 |
> |
if (fgets(buf, MAXLINE, fp) == NULL) |
| 101 |
|
return(-1); |
| 102 |
|
if (buf[0] == '\n') |
| 103 |
|
return(0); |
| 104 |
+ |
#ifdef MSDOS |
| 105 |
+ |
if (buf[0] == '\r' && buf[1] == '\n') |
| 106 |
+ |
return(0); |
| 107 |
+ |
#endif |
| 108 |
|
if (buf[MAXLINE-2] != '\n') { |
| 109 |
|
ungetc(buf[MAXLINE-2], fp); /* prevent false end */ |
| 110 |
|
buf[MAXLINE-2] = '\0'; |