Fix fsload loads wrong file.
PATCH 1/1 Fix fsload loads wrong file.
Hello
Command 'fsload' loads wrong file.
Example
# ls / ...<snip>... -rw-r--r-- 764267 uImage -rw-r--r-- 764267 uImage2 # fsload uImage2 will load uImage.
Please consider to merge.
Patch is attched.
--------
Hiroshi Ito
Media Lab. Inc.,
URL http://www.mlb.co.jp ( Sorry, Japanese only. ) TEL +81-3-5294-7255 FAX +81-3-5294-7256 -------------- next part --------------
fs/cramfs/cramfs.c +3 -1
@@ -97,6 +97,7 @@ static unsigned long cramfs_resolve (uns char *filename) {unsigned long inodeoffset =0 , nextoffset; +int fnamelen=filename?strlen (filename):0 ;while (inodeoffset < size) {struct cramfs_inode *inode;
@@ -125,7 +126,8 @@ static unsigned long cramfs_resolve (uns namelen--; } -if (!strncmp (filename, name, namelen)) { +if (namelen == fnamelen && + !strncmp (filename, name, namelen)) {char *p =strtok (NULL ,"/" );if (raw && (p ==NULL || *p =='\0' ))