--- ray/src/common/header.c 1996/03/12 11:29:16 2.7 +++ ray/src/common/header.c 1998/10/27 08:44:28 2.10 @@ -1,4 +1,4 @@ -/* Copyright (c) 1994 Regents of the University of California */ +/* Copyright (c) 1996 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -57,7 +57,7 @@ register char *r, *s; while (*cp) if (*cp++ != *s++) return(0); if (r == NULL) return(1); - while (*s) *r++ = *s++; + while (*s && !isspace(*s)) *r++ = *s++; *r = '\0'; return(1); } @@ -89,9 +89,8 @@ register FILE *fp; putc(quote, fp); } else fputs(*av++, fp); - putc(' ', fp); + putc(ac ? ' ' : '\n', fp); } - putc('\n', fp); } @@ -154,8 +153,8 @@ char *p; ungetc(buf[MAXLINE-2], fp); /* prevent false end */ buf[MAXLINE-2] = '\0'; } - if (f != NULL) - (*f)(buf, p); + if (f != NULL && (*f)(buf, p) < 0) + return(-1); } }