Commit 50b007da authored by Nils Goroll's avatar Nils Goroll

add variable for clarity

parent 2c43cb9e
...@@ -206,6 +206,7 @@ backref(VRT_CTX, VCL_INT refnum, VCL_STRING fallback, struct vmod_priv *task) ...@@ -206,6 +206,7 @@ backref(VRT_CTX, VCL_INT refnum, VCL_STRING fallback, struct vmod_priv *task)
{ {
ov_t *ov; ov_t *ov;
char *substr; char *substr;
const char *start;
int len; int len;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
...@@ -234,11 +235,11 @@ backref(VRT_CTX, VCL_INT refnum, VCL_STRING fallback, struct vmod_priv *task) ...@@ -234,11 +235,11 @@ backref(VRT_CTX, VCL_INT refnum, VCL_STRING fallback, struct vmod_priv *task)
if (ov->ovector[refnum] == -1) if (ov->ovector[refnum] == -1)
return fallback; return fallback;
start = ov->subject + ov->ovector[refnum];
len = ov->ovector[refnum+1] - ov->ovector[refnum]; len = ov->ovector[refnum+1] - ov->ovector[refnum];
assert(len <= ov->ovector[1] - ov->ovector[0]); assert(len <= ov->ovector[1] - ov->ovector[0]);
WS_Assert_Allocated(ctx->ws, ov->subject + ov->ovector[refnum], len); WS_Assert_Allocated(ctx->ws, start, len);
substr = WS_Printf(ctx->ws, "%.*s", len, substr = WS_Printf(ctx->ws, "%.*s", len, start);
ov->subject + ov->ovector[refnum]);
if (substr == NULL) { if (substr == NULL) {
VSLb(ctx->vsl, SLT_VCL_Error, VSLb(ctx->vsl, SLT_VCL_Error,
"vmod re: insufficient workspace"); "vmod re: insufficient workspace");
......
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