[Top][All Lists]

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

Re: texinfo-5.9.90 pretest available

From: Ken Brown
Subject: Re: texinfo-5.9.90 pretest available
Date: Fri, 27 Feb 2015 08:13:53 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 2/27/2015 2:00 AM, Eli Zaretskii wrote:
Date: Thu, 26 Feb 2015 21:34:03 +0000
From: Gavin Smith <address@hidden>
Cc: Eli Zaretskii <address@hidden>, Karl Berry <address@hidden>, Texinfo 

I checked the 5.2 release and it was done differently. The code looked like:

   if (*compression_program)
     { /* It's compressed, so fclose the file and then open a pipe.  */
       char *command = concat (*compression_program," -cd <", *opened_filename);
       if (fclose (f) < 0)
         pfatal_with_name (*opened_filename);
       f = popen (command, "r");
       if (f)
         *is_pipe = 1;
         pfatal_with_name (command);

The ChangeLog entry on 2014-02-19 explains:

         * install-info/install-info.c (open_possibly_compressed_file):
         Work even if the file name contains arbitrary shell
         metacharacters, for example:
           install-info --info-dir="/d/a b/info" "/d/a b/info/emacs.info.gz"
         Do this by running the decompressor on standard
         input, rather than by having the shell open the file.
         Return either stdin or a pipe.
         Don't bother with IS_PIPE arg; no longer needed.
         All callers changed.  Check for freopen failure.

I wonder if there is a problem with Cygwin with two processes having
the same file open at once, or else.

Ken, could this have something to do with text vs binary I/O mode?
Perhaps the stdin that gzip inherits is not in binary mode, or
something like that?

No, it turns out that it has to do with buffered I/O.  See the thread starting 


Replacing the fseek in line 841 by another call to freopen fixes the problem. I don't know if that's the best solution.


reply via email to

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