delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/30/10:37:38

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 30 Sep 2005 10:36:55 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: A problem with the patch utility and windows paths.
Message-ID: <20050930143655.GB11191@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
References: <433CB39F DOT 2070505 AT byu DOT net> <0MKoyl-1ELLn227mi-00028n AT mrelay DOT perfora DOT net>
Mime-Version: 1.0
In-Reply-To: <0MKoyl-1ELLn227mi-00028n@mrelay.perfora.net>
User-Agent: Mutt/1.5.8i

On Fri, Sep 30, 2005 at 08:23:56AM -0600, Bob Rundle wrote:
>Here is a reproducible script
>
>$ mkdir old
>$ mkdir new
>$ cat >old/file
>Line1
>Asdf
>Line2
>^D
>$ cat >new/file
>Line1
>Fdsa
>Line2
>^D
>$ diff -u old new >1.tm
>$ patch <1.tm
>
>The last command gives the error
>
>can't find file to patch at input line 4
>Perhaps you should have used the -p or --strip option?
>The text leading up to this was:
>--------------------------
>|diff -u old/file new/file
>|--- old/file   2005-09-30 08:15:00.796875000 -0600
>|+++ new/file   2005-09-30 08:16:18.796875000 -0600
>--------------------------
>File to patch:
>
>If then you simply enter old/file at the prompt, then patch works.  This is
>a clear indication that there is a problem with the tool's interpretation of
>a windows path.
>
>This is not a case of "I don't know how patch works."  I have been using
>patch for a long time.  It is simply not working.

If you're attempting to have patch interpret the paths in the patch file
then, as Eric said, you need to specify the "-p" option.  In the above
case, specifying "patch -p0 <1.tm" will cause old/file to be patched.
This is the case on both linux and cygwin.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019