Mail Archives: djgpp/2012/05/12/20:06:43
Am Samstag, 12. Mai 2012 schrieb Eli Zaretskii:
> > From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
> > Date: Wed, 9 May 2012 18:41:36 +0200
> >
> > This is release 2 of the port of GNU Diffutils version 3.2 to MSDOS/DJGPP.
> >
> > Diffutils are a collection of programs for finding differences
> > between files:
> >
> > * diff -- displays differences between 2 files line by line;
> >
> > * diff3 -- displays differences between 3 files (usually, 2 files
> > and their common ancestor);
> >
> > * sdiff -- displays differences between 2 files side by side, and
> > allows to merge between them interactively;
> >
> > * cmp -- displays differences between 2 binary files byte by byte.
> >
> > The documentation of the package includes, in addition to the four
> > programs mentioned above, also the manual for the Patch utility.
>
> I think I found another problem in the ported Diff program. The
> upstream maintainer removed the portions of the code in io.c that
> switched file I/O from text to binary mode and back. See the 2 FIXME
> comments there. The result is that files are read in text mode
> (unless Diff is invoked with the --binary switch), which stops at the
> first ^Z character. So if the first null byte in the file is beyond
> ^Z, Diff will not know that the file is binary, and produce incorrect
> results (e.g. tell that the files are identical when they really
> aren't). I see nothing in djgpp/diffs that would countermand this
> problem.
Really disappointing that they remove code required by other targets. Anyway
I have reverted the current code state to the previous one using the patch you
submitted in:
<http://lists.gnu.org/archive/html/bug-gnulib/2012-05/msg00187.html>
I have followed the thread; no matter what they gnulib maintainers decide,
I think the patch is OK and I will use it to fix this version of diffutils.
It does the right think.
> The easiest fix is to restore the code that was removed (modulo some
> trivial changes due to use of SET_BINARY instead of set_binary_mode).
I have tested with gdb that files containing "binary" data like 0, 1, 2, etc.
beyond a ^Z but not before a ^Z really are identified and read as binary files
when the --binary switch has been omitted.
Sorry but I have found no reference to set_binary_mode, am I missing something
here? Could you please clarify?
Anyway I will upload a new release tomorrow fixing this issue and I will follow
this thread at bug-gnulib. Thanks for calling my attention to the issue.
Regards,
Juan M. Guerrero
- Raw text -