]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
archelp: Fix handling of dot and dotdot at the end of the name.
authorVladimir Serbinenko <phcoder@gmail.com>
Thu, 23 Jul 2015 17:01:00 +0000 (19:01 +0200)
committerVladimir Serbinenko <phcoder@gmail.com>
Thu, 23 Jul 2015 17:01:00 +0000 (19:01 +0200)
Fixes cpio_test and tar_test.

grub-core/fs/archelp.c

index c85cbfac29ebbdce8938e6dbb62930cb9f3ef00b..707f9a658d5ed542aed4788a9a6def6bccf985a1 100644 (file)
@@ -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--);