aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-09-11 11:07:24 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-09-11 11:07:24 -0300
commitcedd2092ebe402e0c6d600969ec926496a8a9d22 (patch)
tree7e783d48fa76f9804d85f6e521f1214f4094865b
parentc473818017ea80d1a55eb3f9047c401e95bf00a0 (diff)
downloadlua-cedd2092ebe402e0c6d600969ec926496a8a9d22.tar.gz
lua-cedd2092ebe402e0c6d600969ec926496a8a9d22.tar.bz2
lua-cedd2092ebe402e0c6d600969ec926496a8a9d22.zip
'coroutine.running' should return nil (instead of nothing) for main thread
-rw-r--r--lbaselib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 4bd6a1f9..a6412d3c 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.190 2006/05/31 16:50:40 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.191 2006/06/02 15:34:00 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -586,9 +586,8 @@ static int luaB_costatus (lua_State *L) {
586 586
587static int luaB_corunning (lua_State *L) { 587static int luaB_corunning (lua_State *L) {
588 if (lua_pushthread(L)) 588 if (lua_pushthread(L))
589 return 0; /* main thread is not a coroutine */ 589 lua_pushnil(L); /* main thread is not a coroutine */
590 else 590 return 1;
591 return 1;
592} 591}
593 592
594 593