MOO-cows Mailing List Archive
[Prev][Next][Index][Thread]
Re: 1.8.0alpha3 delete_verb() bug and patch
sysop@calbbs.com writes:
> There is a bug in verbs.c - bf_delete_verb() that prevented the builtin
> function delete_verb() from doing very much. (Version 1.8.0alpha3)
>
> Replace the following code in the bf_delete_verb() function in verbs.c:
>
> if ((e = validate_verb_descriptor(desc)) != E_NONE)
> /* Do nothing; e is already set. */
> if (!valid(oid))
> e = E_INVARG;
> else if (!db_object_allows(oid, progr, FLAG_WRITE))
> e = E_PERM;
> else {
> h = find_described_verb(oid, desc);
> if (h.ptr)
> db_delete_verb(h);
> else
> e = E_VERBNF;
> }
The simpler fix for this typo is to change the second and third lines of this
as follows:
if ((e = validate_verb_descriptor(desc)) != E_NONE)
; /* Do nothing; e is already set. */
else if (!valid(oid))
Just amazing how important a semicolon (and `else') can be sometimes... :-/
Pavel
References:
Home |
Subject Index |
Thread Index