delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/07/11:16:06

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Wed, 7 Mar 2001 11:15:25 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Cc: d DOT rees DOT l AT usa DOT net
Subject: Re: patch problem with forward/backward slashes in patch file
Message-ID: <20010307111525.E18117@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, d DOT rees DOT l AT usa DOT net
References: <kh2bat4jjv8j6e1vtgdq6jrsj8s02o4co2 AT 4ax DOT com> <4nrbat4k7l19ndugn851cro7072ai9ftqt AT 4ax DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <4nrbat4k7l19ndugn851cro7072ai9ftqt@4ax.com>; from d.rees.l@usa.net on Wed, Mar 07, 2001 at 12:19:29AM -0800

On Wed, Mar 07, 2001 at 12:19:29AM -0800, David Rees wrote:
>First of all the "-d ." in my call is redundant. I had been using it
>for testing, but feel free to ignore it in tracking down the problem.
>
>Also, as I hope I implied (but didn't say) in my previous email,
>altering the diff file to use backward slashes as follows also causes
>patch to run fine:
>|--- src\testcases\org\apache\tools\ant\taskdefs\ZipTest.java   2001/03/02 16:01:01     1.3
>|+++ src\testcases\org\apache\tools\ant\taskdefs\ZipTest.java   2001/03/07 00:11:39

Yeah, you've changed the paths into a format that patch doesn't really
understand, so it just applies the patch to the current directory.
Patch has no idea that '\' is a directory separator.  On Unix, it's a
valid filename character.  However, when this "filename" reaches the
Windows API layour, Windows will translate it into a relative path so
things will "work".

>All this said, using "-p0" or "-p" solves the problem. However, from
>my understanding, patch should do -p0 by default since its a relative
>directory. So what I think seems to be happening is that patch doesn't
>recognize a relative path inside a patch file as relative if it uses
>forward slashes.

Your understanding is incorrect.  Patch does not default to -p0 by
default.  Not supplying -pN on the command line is a common cockpit
error when attempting to apply a patch.  There is nothing strange going
on here besides the fact that you didn't supply -p0 on the command
line.

IMO,
cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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