bug-gnu-utils
[Top][All Lists]
Advanced

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

address@hidden: Bug#140642: patch too clever for its own good when apply


From: Michael Fedrowitz
Subject: address@hidden: Bug#140642: patch too clever for its own good when applying diff-generated ed scripts]
Date: Wed, 3 Apr 2002 17:04:41 +0200
User-agent: Mutt/1.3.28i

 Hi,

another bug from the Debian BTS... The first strategy suggested seems to
make most sense to me. I'll try to come up with a patch later.

-Michael


----- Forwarded message from Anthony Towns <address@hidden> -----

Subject: Bug#140642: patch too clever for its own good when applying 
diff-generated ed scripts
Reply-To: Anthony Towns <address@hidden>, address@hidden
From: Anthony Towns <address@hidden>
To: Debian Bug Tracking System <address@hidden>

Package: patch
Version: 2.5.4-10
Severity: normal

If an ed script generated by diff has a line that contains an "." with
leading spaces, and nothing else, patch takes it upon itself to decide
that the entire patch was indented, and that everything after that point
is weird garbage.

You can duplicate it by having two files:

] Some text.
]
] Some more text.

] An addition.
] 
] Some text.
] 
] A line matching "\s+.\n"
]  .
] And some more gibberish.
] 
] Some more text.

diff --ed from the first to the second produces:

] 1a
] 
] A line matching "\s+.\n"
]  .
] And some more gibberish.
] .
] 0a
] An addition.
] 
] .

Note that the order of the changes in the patch is the opposite of the
changes in the original files.

It's not obvious what the correct heuristic is. Just using the indentation
of the \d+[asc] line at the top rather than the indentation of the
"." is one possibility. Another is not stopping until you get to a
"." with the right level of indentation.

(This bug appeared when using --ed diffs between Debian Packages files,
which often use " ." on a line on its own in descriptions)

Cheers,
aj

-- System Information
Debian Release: 3.0
Architecture: powerpc
Kernel: Linux cyan 2.4.19-pre3-ben0 #1 Wed Mar 20 17:00:20 EST 2002 ppc
Locale: LANG=C, LC_CTYPE=C

Versions of packages patch depends on:
ii  libc6                         2.2.5-3    GNU C Library: Shared libraries an



----- End forwarded message -----



reply via email to

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