From f34a42208153e520d5239be1cea2ca1fbfced9e0 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 23 Jul 2015 19:01:00 +0200 Subject: [PATCH] archelp: Fix handling of dot and dotdot at the end of the name. Fixes cpio_test and tar_test. --- grub-core/fs/archelp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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--);