diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-01-16 10:19:25 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-01-16 10:19:25 +0100 |
commit | 697f070725bc62e4d156e3aabb5a2be93cd685e6 (patch) | |
tree | 144efa7f8f4c2b092855140807dfaf51317c72f3 /src/core | |
parent | e173014aec7ee5b58d5f80e029aeef80201a04ce (diff) | |
download | weechat-697f070725bc62e4d156e3aabb5a2be93cd685e6.zip |
Added new functions and script name completion in script plugins, fixed some bugs in weelist management and script plugins
New functions in script plugins API: gettext, ngettext, list_new, list_add,
list_search, list_casesearch, list_get, list_set, list_next, list_prev,
list_string, list_size, list_remove, list_remove_all, list_free.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-list.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/core/wee-list.c b/src/core/wee-list.c index 8f5e23262..70ed465de 100644 --- a/src/core/wee-list.c +++ b/src/core/wee-list.c @@ -170,7 +170,7 @@ weelist_search (struct t_weelist *weelist, char *data) for (ptr_item = weelist->items; ptr_item; ptr_item = ptr_item->next_item) { - if (string_strcasecmp (data, ptr_item->data) == 0) + if (strcmp (data, ptr_item->data) == 0) return ptr_item; } /* data not found in list */ @@ -247,7 +247,10 @@ weelist_set (struct t_weelist_item *item, char *new_value) struct t_weelist_item * weelist_next (struct t_weelist_item *item) { - return item->next_item; + if (item) + return item->next_item; + + return NULL; } /* @@ -257,7 +260,10 @@ weelist_next (struct t_weelist_item *item) struct t_weelist_item * weelist_prev (struct t_weelist_item *item) { - return item->prev_item; + if (item) + return item->prev_item; + + return NULL; } /* @@ -267,7 +273,10 @@ weelist_prev (struct t_weelist_item *item) char * weelist_string (struct t_weelist_item *item) { - return item->data; + if (item) + return item->data; + + return NULL; } /* @@ -277,7 +286,10 @@ weelist_string (struct t_weelist_item *item) int weelist_size (struct t_weelist *weelist) { - return weelist->size; + if (weelist) + return weelist->size; + + return 0; } /* |