Commit 4b9f7ce4 authored by Geoff Simmons's avatar Geoff Simmons

Fix whitespace.

parent 4dc50186
......@@ -43,13 +43,13 @@
#include "vre2/vre2set.h"
#define ERR(ctx, msg) \
errmsg((ctx), "vmod re2 error: " msg)
errmsg((ctx), "vmod re2 error: " msg)
#define VERR(ctx, fmt, ...) \
errmsg((ctx), "vmod re2 error: " fmt, __VA_ARGS__)
errmsg((ctx), "vmod re2 error: " fmt, __VA_ARGS__)
#define VERRNOMEM(ctx, fmt, ...) \
VERR((ctx), fmt ", out of space", __VA_ARGS__)
VERR((ctx), fmt ", out of space", __VA_ARGS__)
#define INIT(ctx) (((ctx)->method & VCL_MET_INIT) != 0)
......@@ -93,22 +93,22 @@ static const char * const rewrite_name[] = {
static void
errmsg(VRT_CTX, const char *fmt, ...)
{
va_list args;
va_list args;
va_start(args, fmt);
if (ctx->vsl)
VSLbv(ctx->vsl, SLT_VCL_Error, fmt, args);
else
VSLv(SLT_VCL_Error, 0, fmt, args);
va_end(args);
va_start(args, fmt);
if (ctx->vsl)
VSLbv(ctx->vsl, SLT_VCL_Error, fmt, args);
else
VSLv(SLT_VCL_Error, 0, fmt, args);
va_end(args);
if (ctx->method == VCL_MET_INIT) {
AN(ctx->msg);
if (ctx->method == VCL_MET_INIT) {
AN(ctx->msg);
va_start(args, fmt);
VSB_vprintf(ctx->msg, fmt, args);
VSB_vprintf(ctx->msg, fmt, args);
va_end(args);
VRT_handling(ctx, VCL_RET_FAIL);
}
VRT_handling(ctx, VCL_RET_FAIL);
}
}
static void
......@@ -225,19 +225,19 @@ static VCL_STRING
namedref(VRT_CTX, vre2 * restrict vre2, VCL_STRING name, VCL_STRING fallback,
void * const restrict groups, const int ngroups)
{
int refnum;
const char *err;
if ((err = vre2_get_group(vre2, name, &refnum)) != NULL) {
VERR(ctx, ERR_PREFIX "%s", name, fallback, err);
return fallback;
}
if (refnum == -1) {
VERR(ctx, ERR_PREFIX "no such named group", name, fallback);
return fallback;
}
int refnum;
const char *err;
if ((err = vre2_get_group(vre2, name, &refnum)) != NULL) {
VERR(ctx, ERR_PREFIX "%s", name, fallback, err);
return fallback;
}
if (refnum == -1) {
VERR(ctx, ERR_PREFIX "no such named group", name, fallback);
return fallback;
}
assert(refnum > 0 && refnum <= ngroups);
return backref(ctx, refnum, fallback, groups, ngroups);
return backref(ctx, refnum, fallback, groups, ngroups);
}
#undef ERR_PREFIX
......@@ -453,7 +453,7 @@ vmod_regex_namedref(VRT_CTX, struct vmod_re2_regex *re, VCL_STRING name,
if (re->never_capture) {
VERR(ctx, ERR_PREFIX "never_capture is true for object %s",
re->vcl_name, name, fallback, re->vcl_name);
re->vcl_name, name, fallback, re->vcl_name);
return fallback;
}
......@@ -466,7 +466,7 @@ vmod_regex_namedref(VRT_CTX, struct vmod_re2_regex *re, VCL_STRING name,
}
WS_Contains(ctx->ws, task->priv, sizeof(*task_match));
CAST_OBJ(task_match, task->priv, TASK_MATCH_MAGIC);
return namedref(ctx, re->vre2, name, fallback, task_match->groups,
return namedref(ctx, re->vre2, name, fallback, task_match->groups,
re->ngroups);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment