Mercurial > hg > aboriginal
changeset 1454:b37d9183753b
Yet another busybox patch tweak to fix issue noted by John Spencer.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 09 Oct 2011 15:39:57 -0500 |
parents | 0d4c7853b913 |
children | 1dbc3634ad0e |
files | sources/patches/busybox-patch.patch |
diffstat | 1 files changed, 22 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/patches/busybox-patch.patch Sun Oct 09 15:39:57 2011 -0500 @@ -0,0 +1,22 @@ +Make -p count "path components" not slashes, so broken /blah//thing paths work. + +diff --git a/editors/patch.c b/editors/patch.c +index 1f2a49b..b1f51cf 100644 +--- a/editors/patch.c ++++ b/editors/patch.c +@@ -482,11 +482,11 @@ int patch_main(int argc UNUSED_PARAM, char **argv) + + // handle -p path truncation. + for (i=0, s = name; *s;) { ++ char *temp = name; ++ + if ((option_mask32 & FLAG_PATHLEN) && TT.prefix == i) break; +- if (*(s++)=='/') { +- name = s; +- i++; +- } ++ while (*(s++)=='/') name = s; ++ if (temp != name) i++; + } + + if (empty) {