In case you encounter the following error while applying patch in Vista

C:\Projects\jstock>c:\patch-2.5.9-7-bin\bin\patch.exe -p0 < patch.txt

Assertion failed, hunk, file patch.c, line 354

use Notepad++ , go to Format -> Convert to Windows Format. (http://gnuwin32.sourceforge.net/faq.html#Patch_exits_with_the_message_Assertion_failed,_hunk,_file_patch.c,_line_354_)