Permalink
Browse files

Ls command: Empty Folder returns false (issues #129)

1 parent aa4922c commit 9193d1bf92afabe1f24646cb2a713d4562b1a51c yaya committed Feb 4, 2017
Showing with 13 additions and 0 deletions.
  1. +3 −0 ChangeLog_chenall.txt
  2. +5 −0 stage2/fsys_ext2fs.c
  3. +5 −0 stage2/fsys_fat.c
@@ -1,4 +1,7 @@
更新说明:
+2017-02-04(yaya)
+ Ls command: Empty Folder returns false.
+
2016-12-08(yaya)
修正lz4、vhd不显示解压缩进度指示。增加lzma解压缩进度指示。
@@ -888,6 +888,7 @@ ext2fs_dir (char *dirname)
#ifdef E2DEBUG
unsigned char *i;
#endif /* E2DEBUG */
+ int empty = 0;
/* loop invariants:
current_ino = inode to lookup
@@ -1139,6 +1140,8 @@ ext2fs_dir (char *dirname)
{
if (print_possibilities < 0)
{
+ if (!empty)
+ return !(errnum = ERR_FILE_NOT_FOUND);
return 1;
}
@@ -1216,6 +1219,8 @@ ext2fs_dir (char *dirname)
if (print_possibilities > 0)
print_possibilities = -print_possibilities;
print_a_completion (tmp_name, 0);
+ if (*tmp_name != 0x2e)
+ empty = 1;
}
//dp->name[dp->name_len] = saved_c;
View
@@ -505,6 +505,7 @@ fat_dir (char *dirname)
int exfat_nextentry = EXFAT_ENTRY_FILE;
unsigned long long exfat_filemax = 0;
unsigned long exfat_file_cluster = 0;
+ int empty = 0;
// int do_possibilities = 0;
@@ -584,6 +585,8 @@ fat_dir (char *dirname)
{
/* previously succeeded, so return success */
*rest = ch; /* XXX: Should restore the byte? */
+ if (!empty)
+ return !(errnum = ERR_FILE_NOT_FOUND);
return 1;
}
@@ -761,6 +764,8 @@ fat_dir (char *dirname)
if (print_possibilities > 0)
print_possibilities = -print_possibilities;
print_a_completion ((char *)utf8, 1);
+ if (*(char *)utf8 != 0x2e)
+ empty = 1;
}
continue;
}

0 comments on commit 9193d1b

Please sign in to comment.