Standard linux patch hard-coded only for unix text files.
PS: I do no want convert ALL to unix and then convert result back.
To convert from Windows to Linux line breaks you can use the tr command and simply remove the \r characters from the file. The -d option tells the tr command to delete a character, and '\r' specifies the character to delete. The input to tr is redirected from the file fileWindows.
Highlight your project to select it. From the main menu, select menu Tools -> Apply Diff Patch. In the resulting dialog, browse to your patch file, select it, and press the Patch button.
Combined:
dos2unix patchfile.diff
dos2unix $(grep 'Index:' patchfile.diff | awk '{print $2}')
patch --verbose -p0 -i patchfile.diff
unix2dos $(grep 'Index:' patchfile.diff | awk '{print $2}')
The last line depends on whether you want to keep the CRLFs or not.
M.
PS. This should've been a reply to cscrimge's post. DS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With