1
0
Fork 0

Nasal removecommand: use a return value

Change removecommand() to indicate success or failure via a return
value: 1 for success, 0 for failure.
This commit is contained in:
James Turner 2020-09-04 10:56:18 +01:00
parent c6cb845f90
commit 1fd5502e9b

View file

@ -838,9 +838,9 @@ static naRef f_removeCommand(naContext c, naRef me, int argc, naRef* args)
const string commandName(naStr_data(args[0]));
bool ok = nasalSys->removeCommand(commandName);
if (!ok) {
naRuntimeError(c, "Failed to remove command:%s", commandName.c_str());
return naNum(0);
}
return naNil();
return naNum(1);
}
static naRef f_open(naContext c, naRef me, int argc, naRef* args)