X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=inline;f=fs%2Fcramfs%2Fcramfs.c;h=fd8e4ef31e6b7c42d589b3a62726ebbc025ceccc;hb=22a402f00c9de841026105baa219a03d2273c01c;hp=369d1f16740a2abbb040842f994c694f966f8234;hpb=6bf6f114dcdd97ec3f80c2761ed40e31229d6b78;p=oweals%2Fu-boot.git diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c index 369d1f1674..fd8e4ef31e 100644 --- a/fs/cramfs/cramfs.c +++ b/fs/cramfs/cramfs.c @@ -26,9 +26,6 @@ #include #include - -#if defined(CONFIG_CMD_JFFS2) - #include #include #include @@ -44,8 +41,13 @@ struct cramfs_super super; /* CPU address space offset calculation macro, struct part_info offset is * device address space offset, so we need to shift it by a device start address. */ +#if !defined(CONFIG_SYS_NO_FLASH) extern flash_info_t flash_info[]; -#define PART_OFFSET(x) (x->offset + flash_info[x->dev->id->num].start[0]) +#define PART_OFFSET(x) ((ulong)x->offset + \ + flash_info[x->dev->id->num].start[0]) +#else +#define PART_OFFSET(x) ((ulong)x->offset) +#endif static int cramfs_read_super (struct part_info *info) { @@ -125,7 +127,8 @@ static unsigned long cramfs_resolve (unsigned long begin, unsigned long offset, namelen--; } - if (!strncmp (filename, name, namelen)) { + if (!strncmp(filename, name, namelen) && + (namelen == strlen(filename))) { char *p = strtok (NULL, "/"); if (raw && (p == NULL || *p == '\0')) @@ -343,5 +346,3 @@ int cramfs_check (struct part_info *info) } return 1; } - -#endif /* CFG_FS_CRAMFS */