Chris Wilson writes:
authorEric Andersen <andersen@codepoet.org>
Thu, 6 May 2004 09:54:36 +0000 (09:54 -0000)
committerEric Andersen <andersen@codepoet.org>
Thu, 6 May 2004 09:54:36 +0000 (09:54 -0000)
i Erik,

I think I found a small bug in your cramfs patch, which I guess you ported
from mkfs.jffs2.c. Therefore this bug might apply to mkfs.jffs2.c as well.

When searching for a file (or device node) to create in a subdirectory,
mkcramfs doesn't remove the parent's path component which it's already
matched. This prevents the sought node from ever being found if it lives
in a subdirectory.

sources/cramfs.patch

index 1f6f01556e2bcf568d678dff73e1726903e373e4..884eb8cb83c1d48dbc70f2c7cecf8c9a13d422ae 100644 (file)
 +                                      /* Looks like we found a parent of the correct path */
 +                                      if (name[len] == '/') {
 +                                              if (e->child) {
-+                                                      return (find_filesystem_entry (e, name, type));
++                                                      return (find_filesystem_entry (e, name + len + 1, type));
 +                                              } else {
 +                                                      return NULL;
 +                                              }