- if (stat (fs, &stbuf) == -1) {
- fflush(stdout);
- if (clreol)
- cleareol ();
- perror(fs);
- return (NULL);
- }
- if ((stbuf.st_mode & S_IFMT) == S_IFDIR) {
- printf("\n*** %s: directory ***\n\n", fs);
- return (NULL);
- }
- if ((f=Fopen(fs, "r")) == NULL) {
- fflush(stdout);
- perror(fs);
- return (NULL);
- }
- /* Try to see whether it is an ASCII file */
- if (magic(f)) {
- printf("\n******** %s: Not a text file ********\n\n", fs);
- fclose (f);
- return (NULL);
- }
- c = Getc(f);
- if (c == '\f')
- *clearfirst = 1;
- else {
- *clearfirst = 0;
+ if (stat (fs, &stbuf) == -1) {
+ (void)fflush(stdout);
+ if (clreol)
+ cleareol ();
+ perror(fs);
+ return((FILE *)NULL);
+ }
+ if ((stbuf.st_mode & S_IFMT) == S_IFDIR) {
+ printf("\n*** %s: directory ***\n\n", fs);
+ return((FILE *)NULL);
+ }
+ if ((f = Fopen(fs, "r")) == NULL) {
+ (void)fflush(stdout);
+ perror(fs);
+ return((FILE *)NULL);
+ }
+ if (magic(f, fs))
+ return((FILE *)NULL);
+ c = Getc(f);
+ *clearfirst = c == '\f';