projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix AutoLoad macro typos (#2765)
[openwrt.git]
/
package
/
mtd
/
src
/
jffs2.c
diff --git
a/package/mtd/src/jffs2.c
b/package/mtd/src/jffs2.c
index
7b68ae5
..
f614a33
100644
(file)
--- a/
package/mtd/src/jffs2.c
+++ b/
package/mtd/src/jffs2.c
@@
-147,7
+147,7
@@
static void add_file(char *name, int parent)
else
fname = name;
else
fname = name;
- inode = add_dirent(name, IFTODT(S_IFREG), parent);
+ inode = add_dirent(
f
name, IFTODT(S_IFREG), parent);
memset(&ri, 0, sizeof(ri));
ri.magic = JFFS2_MAGIC_BITMASK;
ri.nodetype = JFFS2_NODETYPE_INODE;
memset(&ri, 0, sizeof(ri));
ri.magic = JFFS2_MAGIC_BITMASK;
ri.nodetype = JFFS2_NODETYPE_INODE;
@@
-223,6
+223,9
@@
int mtd_write_jffs2(char *mtd, char *filename, char *dir)
goto done;
}
goto done;
}
+ if (!*dir)
+ target_ino = 1;
+
/* parse the structure of the jffs2 first
* locate the directory that the file is going to be placed in */
for(;;) {
/* parse the structure of the jffs2 first
* locate the directory that the file is going to be placed in */
for(;;) {
@@
-253,7
+256,7
@@
int mtd_write_jffs2(char *mtd, char *filename, char *dir)
struct jffs2_raw_dirent *de = (struct jffs2_raw_dirent *) node;
/* is this the right directory name and is it a subdirectory of / */
struct jffs2_raw_dirent *de = (struct jffs2_raw_dirent *) node;
/* is this the right directory name and is it a subdirectory of / */
- if ((de->pino == 1) && !strncmp(de->name, dir, de->nsize))
+ if (
*dir &&
(de->pino == 1) && !strncmp(de->name, dir, de->nsize))
target_ino = de->ino;
/* store the last inode and version numbers for adding extra files */
target_ino = de->ino;
/* store the last inode and version numbers for adding extra files */
This page took
0.030442 seconds
and
4
git commands to generate.