bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] [PATCH 03/25] Bugfix: Fix NULL filename and output_stream


From: Giuseppe Scrivano
Subject: Re: [Bug-wget] [PATCH 03/25] Bugfix: Fix NULL filename and output_stream in Metalink module
Date: Sun, 11 Sep 2016 21:59:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Matthew White <address@hidden> writes:

> +              */
> +              if (!output_stream && (output_stream = fopen (filename, "rb")))
> +                {
> +                  fclose (output_stream);
> +                  output_stream = fopen (filename, "ab");
> +                }

please use file_exists_p instead of opening and closing the file:

if (!output_stream && file_exists_p (output_stream))
   output_stream = fopen (filename, "ab");

Giuseppe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]