aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Aleaxander <Aleaxander@gmail.com>2009-05-15 05:42:49 +0800
committerLiu Aleaxander <Aleaxander@gmail.com>2009-05-15 05:42:49 +0800
commit5505ac940ddfa5d8579bbe6597016dddc3825b8d (patch)
tree301d5f5463f0b45ed19503ddbbd5757d5147c67c
parentd9441b88b3ad84535f4c2567955a0892f90d38c2 (diff)
downloaddevel-5505ac940ddfa5d8579bbe6597016dddc3825b8d.tar.gz
devel-5505ac940ddfa5d8579bbe6597016dddc3825b8d.tar.xz
devel-5505ac940ddfa5d8579bbe6597016dddc3825b8d.zip
do a reconstructre of the file
-rw-r--r--extlinux.c53
1 files changed, 25 insertions, 28 deletions
diff --git a/extlinux.c b/extlinux.c
index 572544f..ebffb05 100644
--- a/extlinux.c
+++ b/extlinux.c
@@ -125,33 +125,6 @@ int strecpy(char *dst, char *src, char *end)
-
-
-
-/*
- * NOTE! unlike strncmp, ext2_match_entry returns 1 for success, 0 for failure.
- *
- * len <= EXT2_NAME_LEN and de != NULL are guaranteed by caller.
- */
-static inline int ext2_match_entry (const char * const name,
- struct ext2_dir_entry * de)
-{
- if (!de->d_inode)
- return 0;
- return !strncmp(name, de->d_name, de->d_name_len);
-}
-
-
-/*
- * p is at least 6 bytes before the end of page
- */
-inline struct ext2_dir_entry *ext2_next_entry(struct ext2_dir_entry *p)
-{
- return (struct ext2_dir_entry *)((char*)p + p->d_rec_len);
-}
-
-
-
/**
* allocate_file:
*
@@ -612,10 +585,34 @@ int getfssec(char *buf, struct open_file_t *file, int sectors, int *have_more)
+/*
+ * NOTE! unlike strncmp, ext2_match_entry returns 1 for success, 0 for failure.
+ *
+ * len <= EXT2_NAME_LEN and de != NULL are guaranteed by caller.
+ */
+static inline int ext2_match_entry (const char * const name,
+ struct ext2_dir_entry * de)
+{
+ if (!de->d_inode)
+ return 0;
+ return !strncmp(name, de->d_name, de->d_name_len);
+}
+
+
+/*
+ * p is at least 6 bytes before the end of page
+ */
+inline struct ext2_dir_entry *ext2_next_entry(struct ext2_dir_entry *p)
+{
+ return (struct ext2_dir_entry *)((char*)p + p->d_rec_len);
+}
+
+
+
/**
* find_dir_entry:
*
- * find a dir entry, if find it return it or return NULL
+ * find a dir entry, if find return it or return NULL
*
*/
struct ext2_dir_entry* find_dir_entry(struct open_file_t *file, char *filename)