aboutsummaryrefslogtreecommitdiff
path: root/src/variable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/variable.c')
-rw-r--r--src/variable.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/variable.c b/src/variable.c
index 5deda1b..4dbfba5 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -383,7 +383,7 @@ get_symtab(VARIABLE_CTX ctx)
#define getvar(vt, name) symtab_lookup_or_install(vt, name, NULL)
-struct variable *
+static struct variable *
defvar(struct symtab *vt, const char *name, enum variable_type t,
union value *val)
{
@@ -466,7 +466,7 @@ DEF(int, VCL_INT, i)
DEF(real, VCL_REAL, r)
DEF(duration, VCL_DURATION, d)
-VCL_INT
+VCL_BOOL
vmod_defined(VARIABLE_CTX ctx, VCL_STRING name)
{
return !!getvar(get_symtab(ctx), name);
@@ -485,7 +485,7 @@ vmod_undef(VARIABLE_CTX ctx, VCL_STRING name)
symtab_remove(get_symtab(ctx), name);
}
-void
+static void
log_error(const char *fmt, ...)
{
va_list ap;
@@ -601,7 +601,7 @@ str2duration(const char *str)
return *p ? 0 : r;
}
-char *
+static char *
bref_expand(const char *str, const char *input, pcre *re,
int ovsize, int *ovector)
{
@@ -783,12 +783,13 @@ vmod_regset(VARIABLE_CTX ctx, VCL_STRING vars, VCL_STRING rxs,
rxs, vars);
vardef_free(head);
return;
- }
-
- ovsize = (count + 1) * 3;
+ }
+
+ ovsize = (n + 1) * 3;
ovector = calloc(ovsize, sizeof(*ovector));
rc = pcre_exec(re, 0, input, strlen(input), 0, 0, ovector, ovsize);
+
if (rc <= 0) {
if (rc != PCRE_ERROR_NOMATCH)
log_error("variable.regset: pcre_exec failed: %d", rc);

Return to:

Send suggestions and report system problems to the System administrator.