Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
6d7edfce
Commit
6d7edfce
authored
Jan 23, 2016
by
Federico G. Schwindt
Committed by
Lasse Karstensen
Feb 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct ENUM handling in object constructors
Discussed with phk@. Fix confirmed by geoff@. Fixes #1844.
parent
b4359dbb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
vcc_action.c
lib/libvcc/vcc_action.c
+6
-1
vmod.vcc
lib/libvmod_debug/vmod.vcc
+1
-1
vmod_debug_obj.c
lib/libvmod_debug/vmod_debug_obj.c
+2
-1
No files found.
lib/libvcc/vcc_action.c
View file @
6d7edfce
...
...
@@ -203,9 +203,14 @@ parse_new(struct vcc *tl)
s_obj
=
p
;
p
+=
strlen
(
p
)
+
1
;
s_init
=
p
;
while
(
p
[
0
]
!=
'\0'
||
p
[
1
]
!=
'\0'
)
/*
* Check for the end marked (\0\0) followed by s(truct) to avoid
* matching an ENUM half-way through and generating illegal C code.
*/
while
(
p
[
0
]
!=
'\0'
||
p
[
1
]
!=
'\0'
||
p
[
2
]
!=
's'
)
p
++
;
p
+=
2
;
AZ
(
strncmp
(
p
,
"struct vmod_"
,
12
));
s_struct
=
p
;
p
+=
strlen
(
p
)
+
1
;
s_fini
=
p
+
strlen
(
p
)
+
1
;
...
...
lib/libvmod_debug/vmod.vcc
View file @
6d7edfce
...
...
@@ -71,7 +71,7 @@ $Function BACKEND no_backend()
Fails at backend selection
$Object obj(STRING)
$Object obj(STRING
, ENUM { one, two, three } number="one"
)
Test object
...
...
lib/libvmod_debug/vmod_debug_obj.c
View file @
6d7edfce
...
...
@@ -43,13 +43,14 @@ struct vmod_debug_obj {
VCL_VOID
vmod_obj__init
(
VRT_CTX
,
struct
vmod_debug_obj
**
op
,
const
char
*
vcl_name
,
VCL_STRING
s
)
const
char
*
vcl_name
,
VCL_STRING
s
,
VCL_ENUM
e
)
{
struct
vmod_debug_obj
*
o
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
(
void
)
vcl_name
;
(
void
)
s
;
(
void
)
e
;
AN
(
op
);
AZ
(
*
op
);
ALLOC_OBJ
(
o
,
VMOD_DEBUG_OBJ_MAGIC
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment