|
|
|
@ -159,6 +159,7 @@ int shell_cat(struct console *con, size_t argc, const char **argv) |
|
|
|
|
{ |
|
|
|
|
char data[256]; |
|
|
|
|
struct mufs_file *file; |
|
|
|
|
size_t ret; |
|
|
|
|
|
|
|
|
|
if (argc < 1) { |
|
|
|
|
fprintf(con->fp, "usage: mufs cat <path>\n"); |
|
|
|
@ -175,8 +176,8 @@ int shell_cat(struct console *con, size_t argc, const char **argv) |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
while (mufs_read(file, data, sizeof data) != 0) { |
|
|
|
|
fwrite(data, sizeof *data, sizeof data, con->fp); |
|
|
|
|
while ((ret = mufs_read(file, data, sizeof data)) != 0) { |
|
|
|
|
fwrite(data, sizeof *data, ret, con->fp); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
mufs_close(file); |
|
|
|
|