Re: small patch for file(1)

2017-07-01 Thread Nicholas Marriott
ok nicm, it should not fclose this because it didn't open it


On Sat, Jul 01, 2017 at 10:19:32AM -0400, Bryan Steele wrote:
> magic_load() is only called in main and fcloses magicfp immediately,
> this removes a redundant fclose.
> 
> Index: magic-load.c
> ===
> RCS file: /cvs/src/usr.bin/file/magic-load.c,v
> retrieving revision 1.24
> diff -u -p -u -r1.24 magic-load.c
> --- magic-load.c  18 Apr 2017 14:16:48 -  1.24
> +++ magic-load.c  1 Jul 2017 14:16:14 -
> @@ -1169,6 +1169,5 @@ magic_load(FILE *f, const char *path, in
>   }
>   free(tmp);
>  
> - fclose(f);
>   return (m);
>  }



small patch for file(1)

2017-07-01 Thread Bryan Steele
magic_load() is only called in main and fcloses magicfp immediately,
this removes a redundant fclose.

Index: magic-load.c
===
RCS file: /cvs/src/usr.bin/file/magic-load.c,v
retrieving revision 1.24
diff -u -p -u -r1.24 magic-load.c
--- magic-load.c18 Apr 2017 14:16:48 -  1.24
+++ magic-load.c1 Jul 2017 14:16:14 -
@@ -1169,6 +1169,5 @@ magic_load(FILE *f, const char *path, in
}
free(tmp);
 
-   fclose(f);
return (m);
 }