bug-texinfo
[Top][All Lists]
Advanced

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

Re: problem using install-info with tar.info


From: Alan Wehmann
Subject: Re: problem using install-info with tar.info
Date: Wed, 4 Nov 2015 12:38:51 -0600

I believe that I have found and fixed the problem of "install-info tar.info 
dir".

As I had indicated earlier, I was fairly reliably getting errors when using 
install-info on tar-c.info.  This allowed me to study the problem.

I put in a lot of printf statments in "install-info.c" and noticed that the 
failure always seemed to occur in one place.  For reference, I attach a 
compressed tar file containing two "install-info.c" files with sequence numbers 
inserted before each line, plus a successfully built "dir" file and the 
"tar-c.info" file.  One of the "install-info.c" files 
(install-info_altered_seq.c) contains some of the extra print statements that I 
added and the other (install-info_orig_seq.c) does not.

In "install-info_orig_seq.c" the line:

1447              strncat (*outstr, line_out, offset_out);

is where the error occurred.

After some study I decided to try making sure that "line_out" is terminated by 
a '\0' character, so I have the code in "install-info_altered_seq.c":

1465              line_out = (char *) realloc ((void *)line_out, 
allocated_out+1);
1466              line_out[offset_out+1] = '\0';

that adds a '\0' character to "line_out" and allocates space for it.
This seemed to make the problem with “strncat” go away.

In install-info.c there are other lines where one might be concerned about 
"strncat" giving a problem.  They are (from install-info_orig_seq.c):

1482                  strncat (*outstr, line_out, logical_end);
1508              strncat (*outstr, line_out, offset_out);
1520        strncat (*outstr, line_out, offset_out);

but since I didn't run into any problems from these lines I left them alone.


> 
> Alan Wehmann
> address@hidden
> 
> 
> On Nov 1, 2015, at 11:58 AM, Gavin Smith <address@hidden> wrote:
> 
> On 31 October 2015 at 23:30, Alan Wehmann <address@hidden> wrote:
> Neither tar-a.info nor tar-b.info cause an error.  I attach tar-c.info.  It
> causes the error on multiple tries, with or without the presence of a dir
> file.
> 
> I created tar-c.info by copying tar-a.info and adding to it the three lines
> from tar-b.info.
> 
> I also attach tar-d.info.  It is like tar-c.info in having the two entries,
> but inverted.  It does not cause an error, on multiple tries, with or
> without the dir file present.  The dir file is written with the two entries
> inverted from what is in tar-d.info.  I attach the dir file resulting from
> "install-info --debug tar-d.info dir" to illustrate.
> 
> And neither of those files work for me, probably because they have
> MS-DOS line endings. It's possible they've been mangled at some point
> in the transmission of the email.
> 
> When I fix the line endings, both files work, and give the same output
> (inverted for one of them, as you said).
> 
> I probably can't fix this if I can't replicate it.

Attachment: install-info_container.tar.gz
Description: GNU Zip compressed data


reply via email to

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