From: Vladimir Serbinenko Date: Thu, 23 Jul 2015 17:01:00 +0000 (+0200) Subject: archelp: Fix handling of dot and dotdot at the end of the name. X-Git-Tag: 2.02-beta3~243 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f34a42208153e520d5239be1cea2ca1fbfced9e0;p=thirdparty%2Fgrub.git archelp: Fix handling of dot and dotdot at the end of the name. Fixes cpio_test and tar_test. --- diff --git a/grub-core/fs/archelp.c b/grub-core/fs/archelp.c index c85cbfac2..707f9a658 100644 --- a/grub-core/fs/archelp.c +++ b/grub-core/fs/archelp.c @@ -34,12 +34,12 @@ canonicalize (char *name) iptr++; if (iptr[0] == '.' && (iptr[1] == '/' || iptr[1] == 0)) { - iptr += 2; + iptr++; continue; } if (iptr[0] == '.' && iptr[1] == '.' && (iptr[2] == '/' || iptr[2] == 0)) { - iptr += 3; + iptr += 2; if (optr == name) continue; for (optr -= 2; optr >= name && *optr != '/'; optr--);