aboutsummaryrefslogtreecommitdiff
path: root/src/sysbin/shell
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2015-03-14 15:11:29 +0100
committerAlex Auvolat <alex@adnab.me>2015-03-14 15:11:29 +0100
commitf574c22f86d90f735107fda199bb5b4982cd9621 (patch)
tree981c8d3417465e1084eceab05c44bf1f8e4b2017 /src/sysbin/shell
parent51def2fc45d98b59be0413fcb9c25cbb0bbca211 (diff)
downloadkogata-f574c22f86d90f735107fda199bb5b4982cd9621.tar.gz
kogata-f574c22f86d90f735107fda199bb5b4982cd9621.zip
Fix write of null length to channel ; fix cat.
Diffstat (limited to 'src/sysbin/shell')
-rw-r--r--src/sysbin/shell/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/sysbin/shell/main.c b/src/sysbin/shell/main.c
index 2eb2c6c..b093430 100644
--- a/src/sysbin/shell/main.c
+++ b/src/sysbin/shell/main.c
@@ -33,8 +33,7 @@ void cat(char* file) {
while (true) {
size_t r = read(f, p, 128, buf);
p += r;
- buf[r] = 0;
- puts(buf);
+ write(stdio, 0, r, buf);
if (r < 128) break;
}
close(f);
@@ -46,7 +45,7 @@ void cat(char* file) {
int main(int argc, char **argv) {
dbg_printf("[shell] Starting\n");
- fctl(1, FC_SET_BLOCKING, 0);
+ fctl(stdio, FC_SET_BLOCKING, 0);
puts("Kogata shell.\n");