Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.

Commit 15bdc97

Browse files
committed
LFN support complete.
1 parent 36056a2 commit 15bdc97

File tree

5 files changed

+6
-37
lines changed

5 files changed

+6
-37
lines changed

src/.lfn.c.swp

16 KB
Binary file not shown.

src/command.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* [] Creation Date : 21-12-2014
77
*
8-
* [] Last Modified : Sat 27 Dec 2014 11:23:39 AM IRST
8+
* [] Last Modified : Sat 27 Dec 2014 12:41:09 PM IRST
99
*
1010
* [] Created By : Parham Alvani ([email protected])
1111
* =======================================
@@ -83,11 +83,6 @@ void info_command(void)
8383
info();
8484
}
8585

86-
void lls_command()
87-
{
88-
lls();
89-
}
90-
9186
void show_command(char c)
9287
{
9388
switch (c) {
@@ -251,8 +246,6 @@ void command_dispatcher(const char *command)
251246
show_command(c);
252247
} else if (!strcmp(verb, "test_fat")) {
253248
test_fat_command();
254-
} else if (!strcmp(verb, "lls")) {
255-
lls_command();
256249
} else {
257250
printf("404 Not Found\n");
258251
}

src/lfn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
unsigned char *lfn_unicode = NULL;
1717
unsigned char lfn_checksum;
1818
int lfn_slot = -1;
19-
loff_t *lfn_offsets = NULL;
19+
int *lfn_offsets = NULL;
2020
int lfn_parts = 0;
2121

2222
static unsigned char fat_uni2esc[64] = {

src/user.c

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* [] Creation Date : 21-12-2014
77
*
8-
* [] Last Modified : Sat 27 Dec 2014 12:29:51 PM IRST
8+
* [] Last Modified : Sat 27 Dec 2014 12:44:57 PM IRST
99
*
1010
* [] Created By : Parham Alvani ([email protected])
1111
* =======================================
@@ -114,7 +114,7 @@ void list(struct fat_dir_layout *root_dir, int size)
114114
char dis_name[255];
115115
char dis_time[255];
116116
char dis_attr[255];
117-
char dis_full_name[1024];
117+
char dis_full_name[1024] = "";
118118

119119
char *temp = get_name(root_dir[i].name,
120120
root_dir[i].case_information);
@@ -151,7 +151,7 @@ void list(struct fat_dir_layout *root_dir, int size)
151151
char dis_name[255];
152152
char dis_time[255];
153153
char dis_attr[255];
154-
char dis_full_name[1024];
154+
char dis_full_name[1024] = "";
155155

156156
char *temp = get_name(root_dir[i].name,
157157
root_dir[i].case_information);
@@ -371,28 +371,6 @@ void test_fat(void)
371371
printf("We have error on entry %d, %hX != %hX", i, fat_table[i], fat_table_bak[i]);
372372
}
373373

374-
void lls(void)
375-
{
376-
TEST_FD();
377-
int index = 0;
378-
379-
while (1) {
380-
if (index >= fat_boot.root_entry_count)
381-
break;
382-
while (is_lfn(root_dir[index].attr)) {
383-
lfn_add_slot(&root_dir[index], index);
384-
index++;
385-
}
386-
int unknown;
387-
char* name;
388-
389-
name = lfn_get(&root_dir[index], &unknown);
390-
if(name)
391-
printf("%s\n", name);
392-
index++;
393-
}
394-
}
395-
396374
void umount(void)
397375
{
398376
if (fd > 0) {

src/user.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* [] Creation Date : 21-12-2014
77
*
8-
* [] Last Modified : Sat 27 Dec 2014 11:23:51 AM IRST
8+
* [] Last Modified : Sat 27 Dec 2014 12:40:51 PM IRST
99
*
1010
* [] Created By : Parham Alvani ([email protected])
1111
* =======================================
@@ -41,6 +41,4 @@ void dump(const char *dir);
4141

4242
void umount(void);
4343

44-
void lls(void);
45-
4644
#endif

0 commit comments

Comments
 (0)