diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-09-11 11:07:24 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-09-11 11:07:24 -0300 |
commit | cedd2092ebe402e0c6d600969ec926496a8a9d22 (patch) | |
tree | 7e783d48fa76f9804d85f6e521f1214f4094865b | |
parent | c473818017ea80d1a55eb3f9047c401e95bf00a0 (diff) | |
download | lua-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.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 | ||
587 | static int luaB_corunning (lua_State *L) { | 587 | static 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 | ||