I’m attempting to migrate a large preexisting mudlib (originally Lima but heavily modified) to FluffOS. This has brought with it some teething problems that I expected, but also one that appears to be a driver issue: indexing a mapping with a string argument to a function, or a copy of a string argument, seems to be broken on my build. For example, in the following code:
private mapping privileges; // mapping containing all privileges
// (many lines cut here...)
nomask int valid_privilege(mixed p) {
int n;
array list;
string sp;
if (intp (p))
return p == 0 || p == 1;
n = member_array (':', p);
if (n < 0)
n = strlen (p);
sp = p[n+1..];
p = p[0..n-1];
if (sp[<1..<1] == ":")
sp = sp[0..<2];
if (list = privileges[p]) {
if (!strlen(sp))
return 1;
else
return member_array(sp,list)!=-1;
}
return 0;
}
privileges[p] will always evaluate to undefined. It remains undefined if I make a local copy of the string and index against that instead. However, indexing against a string constant with an appropriate value, or a local string variable set to one, will succeed, and member_array(p, keys(privileges)) returns != -1 as expected.
I suspect either an incorrectly configured build or a compatibility issue with my environment, but I’ve been unable to identify any build flags which might affect this behavior. Any pointers?