[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch bug: -D option do not work as expected...

From: Dimitry
Subject: patch bug: -D option do not work as expected...
Date: Wed, 1 Jun 2005 12:54:05 +0600
User-agent: Mutt/1.3.28i

I have a prblem:
when I apply a patch using -D option (I wish to megre OS specific changes 
in my project) the patch utility mix code from different files in the same
#ifdef branch :(

I attach simple example (and test case) to illuminate the bug.
link-a.h and link-b.h --- original files.
link.diff is a patch from link-a.h to link-b.h
link-rez.h is a rezult of
patch -D WIN32 -i link.diff -o link-rez.h

As you can see in the link-rez.h, the contents of the of the first #ifdef 
block is gotten from link-b.h and contents of the second #ifdef block --- 
from link-a.h :(

The right behavior, as I expect, is to use #ifndef declaration or swap #if 
and #else parts for second case.

The version of the patch I use is:
address@hidden:~/tmp/patch.bug$ patch --version
patch 2.5.4
Copyright 1984-1988 Larry Wall
Copyright 1989-1999 Free Software Foundation, Inc.

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

written by Larry Wall and Paul Eggert


Attachment: bug-example.tar.bz2
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]