summaryrefslogtreecommitdiff
path: root/src/user/app/shell/shell.c
diff options
context:
space:
mode:
authordzwdz2022-07-28 18:06:23 +0200
committerdzwdz2022-07-28 18:06:23 +0200
commita0b16620e1699504e8d21a481e019dec40d7ee1b (patch)
tree657835c863dc5cf88d003af29fa9b7836f728cd6 /src/user/app/shell/shell.c
parent473cc957826064840bce7a5c5ff97614e0c6cb9e (diff)
user/shell: redirections
Diffstat (limited to 'src/user/app/shell/shell.c')
-rw-r--r--src/user/app/shell/shell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/user/app/shell/shell.c b/src/user/app/shell/shell.c
index 7367a4b..7f892c0 100644
--- a/src/user/app/shell/shell.c
+++ b/src/user/app/shell/shell.c
@@ -34,7 +34,7 @@ static void execp(char **argv) {
static void run(char *cmd) {
#define ARGV_MAX 16
char *argv[ARGV_MAX];
- char *redir;
+ struct redir redir;
int ret = parse(cmd, argv, ARGV_MAX, &redir);
if (ret < 0) {
@@ -58,7 +58,7 @@ static void run(char *cmd) {
return;
}
- if (redir && !freopen(redir, "w", stdout)) {
+ if (redir.stdout && !freopen(redir.stdout, redir.append ? "a" : "w", stdout)) {
// TODO stderr
exit(0);
}