Ok, this is really, really f^&*ed up.
I have the following 2 functions in wrappers.c:
int remove(const char *name) {
blink_led(3);
return _Remove(name);
}
int remove_test(const char *name) {
blink_led(3);
return _Remove(name);
}
As you can see, they are identical except for the name.
Now I modified os_remove() like this:
static int os_remove (lua_State *L) {
int pula;
const char *filename = luaL_checkstring(L, 1);
pula=os_pushresult(L, remove(filename) == 0, filename);
blink_led(2);
return pula;
}
If I have: pula=os_pushresult(L, remove(filename) == 0, filename); then the LED blinks only 2 times (so remove wasn't even called).
If I have: pula=os_pushresult(L, remove_test(filename) == 0, filename); then the LED blinks 3 times then 2 times.
So WTF is wrong, this drives me crazy.