[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Minor Thing About the Welcome Message.
From: |
Ken Hornstein |
Subject: |
Re: [Nmh-workers] Minor Thing About the Welcome Message. |
Date: |
Wed, 23 Aug 2017 12:08:18 -0400 |
>This uncommited fixes it. This one case anyway.
>
> diff --git uip/mhparse.c uip/mhparse.c
> index 71405616..0fadf786 100644
> --- uip/mhparse.c
> +++ uip/mhparse.c
> @@ -2897,7 +2897,7 @@ openURL (CT ct, char **file)
>
> fseeko(ce->ce_fp, 0, SEEK_SET);
> *file = ce->ce_file;
> - return fd;
> + return fileno(ce->ce_fp);
> }
I guess that's my fault, since I wrote openURL().
>I did notice earlier that openURL() was different from most of the other
>calls of openExternal() in handling its `OK' return value; it returned
>fd instead of ce_fp's fileno(). Here fd is -1, but ce_fp is valid and
>returning its fileno instead gives the dictionary entry as part of the
>email.
>
>I don't know if this is the right fix. Frankly, after staring at
>functions that take a pointer to a struct with an FILE pointer and a
>filename, and also a couple of pointers to return a filename and a file
>descriptor, I'm unclear if the duplicates are meant to always be in
>sync, whether the file descriptor is always the of the FILE pointer if
>that's not NULL, or if sometimes the two filenames should differ...
>There's other messes I was already in the middle of trying to sort out,
>so I'm giving up on this one.
Sigh. I know, that code is a huge mess. It all needs to be thrown out
and rewritten. Some day ...
I think your fix is correct and I will apply it (and pull it up for 1.7).
--Ken