On 3/24/23 14:41, Gavin Smith wrote:
Thanks for the detailed instructions on how to replicate this
problem. I agree that the extra blank line being inserted is
not a good thing.
Could it be fixed by avoiding adding an extra blank line if
not needed, rather than by deleting an extra line?
With your proposed fix, it is possible for a non-blank line
to be removed. So if 'dir' contains
* Menu:
Animals
* Gnu: (gnu). Wildebeest native to Africa.
Livestock
* Cow: (cow). A farm animal.
then running
../ginstall-info --remove --info-dir=. --info-file=./cow; \
../ginstall-info --info-dir=. --info-file=./cow \
cat dir
deletes the "* Gnu (gnu). ..." line.
I think that install-info should handle this case as well, which
would be possible if, for example, somebody hand-edited dir.
Unconditionally removing the line before the section doesn't seem
right.
Very good point, I had rashly assumed the sections would
never occur without an intervening blank line. Also, I will
consider your suggestion to avoid adding the extra blank
line. Will submit a revised patch when I get that done.
Can you think of a legitimate reason for there to be
multiple blank lines (a sequence of more that two
consecutive newline characters) in a valid dir file?
Thank you,
John