capability: do not use strings provided by modules for keyword index, instead duplicate the keyword.

This commit is contained in:
William Pitcock 2012-02-04 04:47:37 -06:00
parent 806402515b
commit e679e38906

View file

@ -31,6 +31,7 @@ struct CapabilityIndex {
#define CAP_REQUIRED 0x2
struct CapabilityEntry {
char *cap;
unsigned int value;
unsigned int flags;
};
@ -63,10 +64,11 @@ capability_put(struct CapabilityIndex *index, const char *cap)
}
entry = rb_malloc(sizeof(struct CapabilityEntry));
entry->cap = rb_strdup(cap);
entry->flags = 0;
entry->value = index->highest_bit;
irc_dictionary_add(index->cap_dict, cap, entry);
irc_dictionary_add(index->cap_dict, entry->cap, entry);
index->highest_bit <<= 1;