git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15257 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
f18696d0ce
commit
608863e8b5
|
@ -374,12 +374,9 @@ static void cmd_ls(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
|
|
||||||
/* Opening the (un)specified directory.*/
|
/* Opening the (un)specified directory.*/
|
||||||
res = vfsOpenDirectory(argc == 1 ? argv[0] : ".", &dirp);
|
res = vfsOpenDirectory(argc == 1 ? argv[0] : ".", &dirp);
|
||||||
if (res == VFS_RET_SUCCESS) {
|
if (!VFS_IS_ERROR(res)) {
|
||||||
while (true) {
|
|
||||||
res = vfsReadDirectoryNext(dirp, nip);
|
while (!VFS_IS_ERROR(vfsReadDirectoryNext(dirp, nip))) {
|
||||||
if (res != VFS_RET_SUCCESS) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
chprintf(chp, "%s" SHELL_NEWLINE_STR, nip->name);
|
chprintf(chp, "%s" SHELL_NEWLINE_STR, nip->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue