From bc84292076945924cd9b006c061ae04d79f4209f Mon Sep 17 00:00:00 2001 From: Toby Goodwin Date: Fri, 16 Mar 2018 20:20:46 +0000 Subject: starting to work --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 9743a2c..9798d9c 100644 --- a/main.c +++ b/main.c @@ -8,6 +8,7 @@ bool dashdee, dashee, dashvee, dashex, dasheye, dashen, dashpee, interactive; +char *dashsee[2]; pid_t rc_pid; static bool dashEYE, dashell, dashoh, dashess; @@ -16,7 +17,7 @@ static void assigndefault(char *,...); static void checkfd(int, enum redirtype); extern int main(int argc, char *argv[], char *envp[]) { - char *dashsee[2], *dollarzero, *null[1]; + char *dollarzero, *null[1]; int c; initprint(); dashsee[0] = dashsee[1] = NULL; -- cgit v1.2.3 From 9c7ee8473a71303ab4cb51c9593089c07c224a22 Mon Sep 17 00:00:00 2001 From: Toby Goodwin Date: Fri, 16 Mar 2018 20:39:43 +0000 Subject: flag largely working, flag n + is a bit odd --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 9798d9c..a8dfb0a 100644 --- a/main.c +++ b/main.c @@ -8,10 +8,10 @@ bool dashdee, dashee, dashvee, dashex, dasheye, dashen, dashpee, interactive; +bool dashEYE, dashell, dashoh, dashess; char *dashsee[2]; pid_t rc_pid; -static bool dashEYE, dashell, dashoh, dashess; static void assigndefault(char *,...); static void checkfd(int, enum redirtype); -- cgit v1.2.3 From cccdab7ea2bb922413f02698ecc5969c00e7a7aa Mon Sep 17 00:00:00 2001 From: Toby Goodwin Date: Sat, 17 Mar 2018 15:14:21 +0000 Subject: tidy up, test cases, document flag --- main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index a8dfb0a..c5dc5d5 100644 --- a/main.c +++ b/main.c @@ -6,9 +6,10 @@ #include "input.h" -bool dashdee, dashee, dashvee, dashex, dasheye, - dashen, dashpee, interactive; -bool dashEYE, dashell, dashoh, dashess; +bool dashdee, dashee, dasheye, dashell, dashen; +bool dashpee, dashoh, dashess, dashvee, dashex; +bool interactive; +static bool dashEYE; char *dashsee[2]; pid_t rc_pid; @@ -68,8 +69,10 @@ extern int main(int argc, char *argv[], char *envp[]) { } quitopts: argv += rc_optind; - /* use isatty() iff neither -i nor -I is set, and iff the input is not from a script or -c flags */ - if (!dasheye && !dashEYE && dashsee[0] == NULL && (dashess || *argv == NULL)) + /* use isatty() iff neither -i nor -I is set, and iff the input is not + * from a script or -c flags */ + if (!dasheye && !dashEYE && dashsee[0] == NULL && + (dashess || *argv == NULL)) interactive = isatty(0); if (!dashoh) { checkfd(0, rFrom); -- cgit v1.2.3