diff options
Diffstat (limited to 'fallback.c')
-rw-r--r-- | fallback.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_fallback="$Id: fallback.c,v 1.15 1995/10/09 13:14:29 roberto Exp roberto $"; | 6 | char *rcs_fallback="$Id: fallback.c,v 1.16 1995/10/17 11:52:38 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | #include <string.h> | 9 | #include <string.h> |
@@ -48,10 +48,7 @@ void luaI_setfallback (void) | |||
48 | char *name = lua_getstring(lua_getparam(1)); | 48 | char *name = lua_getstring(lua_getparam(1)); |
49 | lua_Object func = lua_getparam(2); | 49 | lua_Object func = lua_getparam(2); |
50 | if (name == NULL || !(lua_isfunction(func) || lua_iscfunction(func))) | 50 | if (name == NULL || !(lua_isfunction(func) || lua_iscfunction(func))) |
51 | { | 51 | lua_error("incorrect argument to function `setfallback'"); |
52 | lua_pushnil(); | ||
53 | return; | ||
54 | } | ||
55 | for (i=0; i<N_FB; i++) | 52 | for (i=0; i<N_FB; i++) |
56 | { | 53 | { |
57 | if (strcmp(luaI_fallBacks[i].kind, name) == 0) | 54 | if (strcmp(luaI_fallBacks[i].kind, name) == 0) |
@@ -62,7 +59,7 @@ void luaI_setfallback (void) | |||
62 | } | 59 | } |
63 | } | 60 | } |
64 | /* name not found */ | 61 | /* name not found */ |
65 | lua_pushnil(); | 62 | lua_error("incorrect argument to function `setfallback'"); |
66 | } | 63 | } |
67 | 64 | ||
68 | 65 | ||