From 0ad2a46f33944b5fedbda54167af5739c8c5ed84 Mon Sep 17 00:00:00 2001 From: jilles Date: Thu, 25 Jul 2013 15:08:41 +0000 Subject: sh: Remove mkinit. Replace the RESET blocks with regular functions and a reset() function that calls them all. This code generation tool is unusual and does not appear to provide much benefit. I do not think isolating the knowledge about which modules need to be reset is worth an almost 500-line build tool and wider scope for variables used by the reset functions. Also, relying on reset functions is often wrong: the cleanup should be done in exception handlers so that no stale state remains after 'command eval' and the like. --- bin/sh/input.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'bin/sh/input.c') diff --git a/bin/sh/input.c b/bin/sh/input.c index f574f46..c5b1828 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -108,15 +108,12 @@ static void pushfile(void); static int preadfd(void); static void popstring(void); -#ifdef mkinit -INCLUDE "input.h" -INCLUDE "error.h" - -RESET { +void +resetinput(void) +{ popallfiles(); parselleft = parsenleft = 0; /* clear input buffer */ } -#endif /* -- cgit v1.1