Bug 7736 - patch ORIGFILE PATCHFILE uses the wrong file path
Summary: patch ORIGFILE PATCHFILE uses the wrong file path
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.22.x
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-21 18:43 UTC by Andreas Klauer
Modified: 2016-01-23 04:14 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Klauer 2014-12-21 18:43:35 UTC
I'm trying to patch a file in a subdir. According to busybox patch --help this syntax should be supported, but it does not work...

Expected behaviour:

$ patch subdir/a some.patch
patching file subdir/a

But BusyBox ignores the subdir completely:

$ busybox patch subdir/a some.patch
patching file a
patch: can't open 'a': No such file or directory

If a file exists in the current dir, it tries to patch that instead:

$ touch a
$ busybox patch subdir/a some.patch
patching file a
Hunk 1 FAILED 1/1.
-foobar
+barfoo

Even if it succeeds, subdir/a remains unpatched.
Comment 1 Denys Vlasenko 2016-01-23 04:14:36 UTC
Fixed in git. Thanks!