From aaf2e8a1e5d064ad2949597df4f6a947e5da71d1 Mon Sep 17 00:00:00 2001 From: Marian Ohligs Date: Sun, 25 Sep 2011 12:59:38 +0200 Subject: [PATCH] - bug fix in mshell --- newlib/examples/mshell.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/newlib/examples/mshell.c b/newlib/examples/mshell.c index 2f03fe4a..ecc86513 100644 --- a/newlib/examples/mshell.c +++ b/newlib/examples/mshell.c @@ -137,8 +137,11 @@ int ms_cat(char* filename) fd = open(filename, 0, "wr"); - if ((!filename) || (fd < 0)) - printf("cat: No such file or directory"); + if (fd < 0) { + printf("cat: No such file or directory"); + printf("\n"); + return -1; + } do { r = read(fd, buffer, 1024);