patch command on windows
  • zooechometa December 2011
    not sure what's the correct category, sorry.

    I don't think I saw anything else on this question in forum.

    I'm on windows XP pro. I'm working on the "patch" mission. I had to download the patch command. When I run it from the command line, I get the response: "This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information."

    Any suggestions on how to fix this? (I used the command as described in the mission assignment).

    Thanks.
  • ililililili December 2011
    I have a similar problem. I'm also on windows and I've downloaded the patch command. When I run patch from the command line I get the response:

    'patch' is not recognized as an internal or external command, operable program or batch file.
  • zooechometa December 2011
    Not sure if this will help, but just throwing it out there in case it does.

    In my case, the command is running but the windows system has some problem executing it.

    In your case, I think the message is telling you that it can't find the executable; it doesn't know where to find it - it is neither an internal windows command nor can it be found as a non-windows executable.

    So possibly try the path command, (there are many tutorials - just google). Another thing you can try is to use the cd command so that you are running the patch command in the directory where it is stored.

    So if you installed the patch command in c:\programs\patch, then run cd c:\programs\patch before you run patch. In this case, the command prompt should read the same directory where the command is stored.
  • zooechometa December 2011
    OK, sorry, I think you have to run the command in the directory that contains the downloaded c and patch files per the instructions.

    So if you don't use the path command, then you need to preface the patch command with the full path to where the patch command is installed, and be sure to run it from the directory that contains the .c and .patch files.
  • zooechometa December 2011
    As for me, I got a little bit further. I get the patch to run, and it seems to find the .c file, (it says "patching file fib1.c") however, now it says that:

    "Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354" before again telling me that the application requested the runtime to terminate in an unusual way.

    Any ideas on what the problem is? Thanks
  • paulproteus January 2012
    Hi zooechometa and ililililili,

    Sorry you're running into a crashing problem with "patch"!

    Did you set it up with "Git Bash"? If not, go to http://openhatch.org/missions/windows-setup and check out our new instructions for setting up patch and other commands.

    Once you have a "GIt Bash" environment, do things work properly?
  • techtoniktechtonik February 2012
    This Python script may help - http://python-patch.googlecode.com/svn/trunk/patch.py - it's not perfect, for example doesn't create new files and folders, but at least tries to be crossplatform and user friendly.
  • zooechometa February 2012
    yes, I've installed gitbash and run from the $ prompt with header:
    Welcome to Git (version 1.7.9-preview20120201), etc.
    This gives the assertion failed message.

    I'm not familiar with python. Looks like a large script. So how would we use it to complete the patch mission?

    Thanks all.
  • LaurentGoderre October 2012
    zooechometa,

    this is very late I know but I think your problem is with the line endings. The documentation for Patch for Windows talks to it in its documentation

    http://gnuwin32.sourceforge.net/packages/patch.htm

Welcome to the OpenHatch forums!

OpenHatch is a community of people aiming to help newcomers find their way into free software projects. If you like talking about that, please join the conversation!

Sign in or register (ignoreme)