diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-02-13 13:39:16 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-02-13 13:49:47 +0200 |
commit | ff77b396197ae9d4891831efda4d3a0c7f71b6e4 (patch) | |
tree | ea16465b368ccc37ac5f3c0160b9852813665e70 | |
parent | e6754a1b721358b5588f67bdb7eef6ab662c0ee2 (diff) | |
download | vmod-variable-ff77b396197ae9d4891831efda4d3a0c7f71b6e4.tar.gz vmod-variable-ff77b396197ae9d4891831efda4d3a0c7f71b6e4.tar.bz2 |
Bugfixes
* src/variable.c (vmod_defined): Fix return type.
(vmod_regset): Fix ovsize calculation.
* src/variable.vcc (defined): Fix return type.
-rw-r--r-- | src/variable.c | 15 | ||||
-rw-r--r-- | src/variable.vcc | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/variable.c b/src/variable.c index 5deda1b..4dbfba5 100644 --- a/src/variable.c +++ b/src/variable.c @@ -385,3 +385,3 @@ get_symtab(VARIABLE_CTX ctx) -struct variable * +static struct variable * defvar(struct symtab *vt, const char *name, enum variable_type t, @@ -468,3 +468,3 @@ DEF(duration, VCL_DURATION, d) -VCL_INT +VCL_BOOL vmod_defined(VARIABLE_CTX ctx, VCL_STRING name) @@ -487,3 +487,3 @@ vmod_undef(VARIABLE_CTX ctx, VCL_STRING name) -void +static void log_error(const char *fmt, ...) @@ -603,3 +603,3 @@ str2duration(const char *str) -char * +static char * bref_expand(const char *str, const char *input, pcre *re, @@ -785,5 +785,5 @@ vmod_regset(VARIABLE_CTX ctx, VCL_STRING vars, VCL_STRING rxs, return; - } - - ovsize = (count + 1) * 3; + } + + ovsize = (n + 1) * 3; ovector = calloc(ovsize, sizeof(*ovector)); @@ -791,2 +791,3 @@ vmod_regset(VARIABLE_CTX ctx, VCL_STRING vars, VCL_STRING rxs, rc = pcre_exec(re, 0, input, strlen(input), 0, 0, ovector, ovsize); + if (rc <= 0) { diff --git a/src/variable.vcc b/src/variable.vcc index f0106e9..9bf8f46 100644 --- a/src/variable.vcc +++ b/src/variable.vcc @@ -32,3 +32,3 @@ $Function VOID clear() -$Function INT defined(STRING) +$Function BOOL defined(STRING) $Function STRING type_of(STRING) |