From cedd2092ebe402e0c6d600969ec926496a8a9d22 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 11 Sep 2006 11:07:24 -0300 Subject: 'coroutine.running' should return nil (instead of nothing) for main thread --- lbaselib.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index 4bd6a1f9..a6412d3c 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.190 2006/05/31 16:50:40 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.191 2006/06/02 15:34:00 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -586,9 +586,8 @@ static int luaB_costatus (lua_State *L) { static int luaB_corunning (lua_State *L) { if (lua_pushthread(L)) - return 0; /* main thread is not a coroutine */ - else - return 1; + lua_pushnil(L); /* main thread is not a coroutine */ + return 1; } -- cgit v1.2.3-55-g6feb