Bug 7736

Summary: patch ORIGFILE PATCHFILE uses the wrong file path
Product: Busybox Reporter: Andreas Klauer <Andreas.Klauer>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: minor CC: busybox-cvs
Priority: P5    
Version: 1.22.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

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!