[Top][All Lists]

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

Re: Questions about patch

From: Gary Setter
Subject: Re: Questions about patch
Date: Sun, 3 Apr 2005 11:51:30 -0500

----- Original Message ----- 
From: "Eli Zaretskii" <address@hidden>
To: "Gary Setter" <address@hidden>
Cc: <address@hidden>; <address@hidden>
Sent: Saturday, April 02, 2005 5:06 AM
Subject: Re: Questions about patch

> > From: "Gary Setter" <address@hidden>
> > Date: Fri, 1 Apr 2005 08:08:10 -0600
> > Cc: address@hidden
> >
> > I'm sorry to take so long to respond to your e-mail. I've
> > some tests on my humble PC, and have not yet been able to
> > a version that is portable and that accepts diff files of all
> > types. I have one problem with three parts. The parts are:
> > use of cr/lf to terminate lines verses, opening files as
> > verses text and the failure of the fseek() function.
> >
> > The problem has a long history. Based on the newsgroups that
> > been reading, the consensus is that the above fseek was not
> > to work with text files.
> I'm not Paul Eggert, but I'll try to put in my $0.02.
> I know one implementation of fseek that does work with text
files: the
> one in the DJGPP project's (http://www.delorie.com/djgpp/)
> > That seems to mean that patch should
> > open files to read in binary mode only, throw out carriage
> > returns, and terminate lines where line feeds are found.
> I believe latest versions of Patch already do that: they remove
> characters near the end of the line and print a message to that
> effect.
> > I have no problem doing that, but it would make the existing
> > --binary meaningless.
> The --binary switch affects _output_, not only _input_.  So,
> Patch is invoked with this switch, it produces patched files in
> format, i.e. each line is terminated by a single LF character.
> is not what you might want, at least not in every situation.
> In other words, --binary is mainly meant for the situation
where you
> patch Unix-style files, and the patch file itself is in Unix

Hi Eli,
Your right, but would it be more useful to implement two mutually
exclusive switches -terminatelineslf and --terminatelinesdefault
to choose between opening output files as binary vs text files;
and then consistently reading files as binary (throwing out cr)?

Where is the source for the latest versions of patch kept?

I had a second question, is a portable version of patch needed?
That is one compatible with more Windows compilers?
Best regards,
Gary Setter

reply via email to

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