1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 01:33:12 +02:00

core: allow index for hdata arrays in evaluation of expressions

This commit is contained in:
Sébastien Helleu
2017-05-20 00:05:31 +02:00
parent 455a0e501c
commit 925e8b79a8
3 changed files with 7 additions and 3 deletions
+1
View File
@@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
Improvements::
* core: allow index for hdata arrays in evaluation of expressions
* buflist: add variable `${current_buffer}` (boolean "0" / "1") in bar item evaluation
Bug fixes::
+4 -3
View File
@@ -147,8 +147,8 @@ char *
eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path)
{
char *value, *old_value, *var_name, str_value[128], *pos;
const char *ptr_value, *hdata_name;
int type;
const char *ptr_value, *hdata_name, *ptr_var_name;
int type, index;
struct t_hashtable *hashtable;
value = NULL;
@@ -180,7 +180,8 @@ eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path)
goto end;
/* search type of variable in hdata */
type = hdata_get_var_type (hdata, var_name);
hdata_get_index_and_name (var_name, &index, &ptr_var_name);
type = hdata_get_var_type (hdata, ptr_var_name);
if (type < 0)
goto end;
+2
View File
@@ -110,6 +110,8 @@ extern int hdata_check_pointer (struct t_hdata *hdata, void *list,
extern void *hdata_move (struct t_hdata *hdata, void *pointer, int count);
extern void *hdata_search (struct t_hdata *hdata, void *pointer,
const char *search, int move);
extern void hdata_get_index_and_name (const char *name, int *index,
const char **ptr_name);
extern char hdata_char (struct t_hdata *hdata, void *pointer,
const char *name);
extern int hdata_integer (struct t_hdata *hdata, void *pointer,