Re: Handling of CRLF/LF in patch and diff

"Kees Zeelenberg" <[email protected]>
Newsgroups gmane.comp.windows.gnu.user
Message-ID <000301c726e2$bd945db0$34106550@gamma>
I think the simplest way to start is without the rc file, without libgw32c, 
and without any new options. Just type ./configure at the bash prompt, and 
after it is finished: make.
I thought the difficulties with patch could only be caused by (f)seek / 
(f)tell, but I never found the exact place.

Hope this helps,

Kees

----- Original Message ----- 
From: "Lennart Borgman" <[email protected]>
To: "Kees Zeelenberg" <[email protected]>
Sent: Saturday, December 23, 2006 9:45 PM
Subject: Re: [GnuWin32-Users] Handling of CRLF/LF in patch and diff


> Hi Kees,
>
> Thank for answering. It is good to hear diff is alreay working the way I 
> want it to.
>
> However patch is a bigger problem. It is very difficult to make a 
> workaround in the case of patch since a patch file can be applied to 
> several files. Could you perhaps help me get started a bit?
>
> I am by no means a seasoned C programmer. I have downloaded the sources to 
> patch, the setup file, but I do not get very far. Some problems:
>
> - The .rc file to patch is not a text file as it should be. Perhaps have 
> it for some reason been replaced by the .res file? Could I perhaps replace 
> it with those that comes with diff? They look like some kind of templates 
> to me.
>
> - I do not have knowledge to fill in what is missing in the instructions 
> to build. I have installed libgw32c, but what do I do after this? I guess 
> I should run configure, but how do I make it aware of libgw32c?
>
> - Where do I put the -mms-bitfields etc options? Do I tell configure about 
> them in some way?
>
> - Do you have some hints from your own search for a solution the LF 
> problem with patch?
>
>
> Best wishes,
> L
>
>
>
> Kees Zeelenberg wrote:
>> Most Gnuwin32 ports work as well with CRLF as with LF, because in text 
>> mode, the read and write functions from msvcrt.dll convert CRLF 
>> internally to LF on reading and the other way around for writing. The 
>> only problem occurs when seek or tell functions are used. A solution 
>> seems only possible by letting the program first scan the input and then 
>> guess which of CRLF / LF was used on input. This requires a lot of 
>> programming and even then wrong choices are possible. So I doubt that an 
>> easy solution is possible.
>> I think that diff is insensitive to CRLF / LF. As for patch, I've never 
>> succeeded in finding the exact cause of its breaking on patch files with 
>> LF.
>>
>> Kees Zeelenberg
>>
>> ----- Original Message ----- From: "Lennart Borgman" 
>> <[email protected]>
>> To: <[email protected]>
>> Sent: Saturday, December 23, 2006 3:24 AM
>> Subject: [GnuWin32-Users] Handling of CRLF/LF in patch and diff
>>
>>
>>> It sometimes happens that you receive patch files with a different line
>>> formats than the file to patch. Other times you may want to compare two
>>> files that have different line endings. I think that if you work on a
>>> project that is crossplatform or if you happen to get the file or patch
>>> via mail those situations can occur.
>>>
>>> Working crossplatform is of course one of the reasons for gnuwin32 to
>>> exist. It would IMHO be very good if patch and diff could handle those
>>> situations. Currently I have been thinking about different ways to fix
>>> this when using patch and diff from inside Emacs, but I wonder whether
>>> that is the way to go. Fixing the patch and diff programs themselves
>>> seems better to me.
>>>
>>> Have someone on this list thought about this? Would it be difficult to
>>> do? I would suggest adding a new argument option for this of course.
>>>
>>>
>>>
>>> BTW did someone see my little perl script for downloading of gnuwin32? :
>>>
>>>    http://ourcomments.org/Emacs/DL/w32%20util/gnuwin32/
>>>
>>> (The html doc is not quite up to date at the moment. And sometimes you
>>> have a problem with the web pages from sourceforge. Other than that it
>>> works I think.)
>>>
>>> -------------------------------------------------------------------------
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to share 
>>> your
>>> opinions on IT & business topics through brief surveys - and earn cash
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>> _______________________________________________
>>> GnuWin32-Users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/gnuwin32-users
>>>
>>>
>>>
>>
>
>
>
> 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.