capability: do not use strings provided by modules for keyword index, instead duplicate the keyword.
This commit is contained in:
parent
806402515b
commit
e679e38906
1 changed files with 3 additions and 1 deletions
|
@ -31,6 +31,7 @@ struct CapabilityIndex {
|
||||||
#define CAP_REQUIRED 0x2
|
#define CAP_REQUIRED 0x2
|
||||||
|
|
||||||
struct CapabilityEntry {
|
struct CapabilityEntry {
|
||||||
|
char *cap;
|
||||||
unsigned int value;
|
unsigned int value;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
@ -63,10 +64,11 @@ capability_put(struct CapabilityIndex *index, const char *cap)
|
||||||
}
|
}
|
||||||
|
|
||||||
entry = rb_malloc(sizeof(struct CapabilityEntry));
|
entry = rb_malloc(sizeof(struct CapabilityEntry));
|
||||||
|
entry->cap = rb_strdup(cap);
|
||||||
entry->flags = 0;
|
entry->flags = 0;
|
||||||
entry->value = index->highest_bit;
|
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;
|
index->highest_bit <<= 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue