--- ray/src/util/getinfo.c 2022/03/21 00:21:13 2.23 +++ ray/src/util/getinfo.c 2022/04/13 15:43:06 2.25 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: getinfo.c,v 2.23 2022/03/21 00:21:13 greg Exp $"; +static const char RCSid[] = "$Id: getinfo.c,v 2.25 2022/04/13 15:43:06 greg Exp $"; #endif /* * getinfo.c - program to read info. header from file. @@ -62,8 +62,10 @@ adjheadline( /* check for lines to remove */ } if (s1 == s) continue; - if (isspace(*s1) && !*s2 | isspace(*s2)) - return(0); /* skip */ + if ((*s1 == '=') & !*s2) + return(0); + if (isspace(*s1) & isspace(*s2)) + return(0); } fputs(s, stdout); /* copy if no match */ return(0); @@ -135,6 +137,7 @@ main( } #ifdef getc_unlocked /* avoid lock/unlock overhead */ flockfile(stdin); + flockfile(stdout); #endif SET_FILE_BINARY(stdin); if (argc > 2 && !strcmp(argv[1], "-c")) { @@ -228,6 +231,9 @@ main( if ((fp = fopen(argv[i], "r")) == NULL) fputs(": cannot open\n", stdout); else { +#ifdef getc_unlocked /* avoid lock/unlock overhead */ + flockfile(fp); +#endif if (dim < 0) { /* dimensions only */ if (getheader(fp, NULL, NULL) < 0) { fputs("bad header!\n", stdout);