checkpatch: fix filename detection when using -f
commit1a5c63ce88e92de163c592505c2e2153476b9345
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Aug 2018 14:35:19 +0000 (10 16:35 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Aug 2018 11:32:50 +0000 (23 13:32 +0200)
tree69098d7373d9bbb45f8101be84daac317629bd17
parentedd7541b8ce25c1180eb5435ff3350a76d0f0b95
checkpatch: fix filename detection when using -f

Fix $realfile filename when using -f/--file to not remove first level
directory as if the filename was used in a -P1 patch.  Only strip the
first level directory (typically a or b) for P1 patches.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(extracted from Linux commit 2b7ab45395dc4d91ef30985f76d90a8f28f58c27)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/checkpatch.pl