From ad7328341af15585f1dee4fbb63f288d2b2917e2 Mon Sep 17 00:00:00 2001 From: jilles Date: Wed, 4 Sep 2013 22:10:16 +0000 Subject: sh: Make return return from the closest function or dot script. Formerly, return always returned from a function if it was called from a function, even if there was a closer dot script. This was for compatibility with the Bourne shell which only allowed returning from functions. Other modern shells and POSIX return from the function or the dot script, whichever is closest. Git 1.8.4's rebase --continue depends on the POSIX behaviour. Reported by: Christoph Mallon, avg --- bin/sh/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/sh/main.c') diff --git a/bin/sh/main.c b/bin/sh/main.c index 295f277..e4974ea 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -231,7 +231,7 @@ cmdloop(int top) popstackmark(&smark); setstackmark(&smark); if (evalskip != 0) { - if (evalskip == SKIPFILE) + if (evalskip == SKIPRETURN) evalskip = 0; break; } -- cgit v1.1