Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
91aa105c
...
91aa105c038a290f9fe4e1fe22a4a2c4b2c020a3
authored
2002-11-13 13:35:00 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(sieve_code_command): Implemented implicit typecast from string to string-list.
1 parent
5b62b3d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
28 deletions
libsieve/prog.c
libsieve/prog.c
View file @
91aa105
...
...
@@ -35,8 +35,8 @@ sieve_code (sieve_op_t *op)
sizeof
sieve_machine
->
prog
[
0
]);
if
(
!
newprog
)
{
sieve_
error
(
"%s:%d: out of memory!"
,
sieve_filename
,
sieve_line_num
);
sieve_
compile_error
(
sieve_filename
,
sieve_line_num
,
"out of memory!"
);
return
1
;
}
sieve_machine
->
prog
=
newprog
;
...
...
@@ -124,9 +124,9 @@ sieve_code_command (sieve_register_t *reg, list_t arglist)
if
(
rc
)
{
sieve_
error
(
"%s:%d: can't create iterator: %s"
,
sieve_filename
,
sieve_line_num
,
mu_errstring
(
rc
));
sieve_
compile_error
(
sieve_filename
,
sieve_line_num
,
"can't create iterator: %s"
,
mu_errstring
(
rc
));
return
1
;
}
...
...
@@ -142,8 +142,8 @@ sieve_code_command (sieve_register_t *reg, list_t arglist)
sieve_tag_def_t
*
tag
=
find_tag
(
reg
->
tags
,
val
->
v
.
string
);
if
(
!
tag
)
{
sieve_
error
(
"%s:%d: invalid tag name `%s' for `%s'"
,
sieve_filename
,
sieve_line_num
,
sieve_
compile_error
(
sieve_filename
,
sieve_line_num
,
"invalid tag name `%s' for `%s'"
,
val
->
v
.
string
,
reg
->
name
);
err
=
1
;
break
;
...
...
@@ -151,9 +151,9 @@ sieve_code_command (sieve_register_t *reg, list_t arglist)
if
(
!
tag_list
&&
(
rc
=
list_create
(
&
tag_list
)))
{
sieve_
error
(
"%s:%d: can't create tag list: %s"
,
sieve_filename
,
sieve_line_num
,
mu_errstring
(
rc
));
sieve_
compile_error
(
sieve_filename
,
sieve_line_num
,
"%s:%d: can't create tag list: %s"
,
mu_errstring
(
rc
));
err
=
1
;
break
;
}
...
...
@@ -174,28 +174,45 @@ sieve_code_command (sieve_register_t *reg, list_t arglist)
}
else
if
(
*
exp_arg
==
SVT_VOID
)
{
sieve_error
(
"%s:%d: too many arguments in call to `%s'"
,
sieve_filename
,
sieve_line_num
,
reg
->
name
);
err
=
1
;
break
;
}
else
if
(
*
exp_arg
!=
val
->
type
)
{
sieve_error
(
"%s:%d: type mismatch in argument %d to `%s'"
,
sieve_filename
,
sieve_line_num
,
exp_arg
-
reg
->
req_args
+
1
,
reg
->
name
);
sieve_compile_error
(
sieve_filename
,
sieve_line_num
,
"too many arguments in call to `%s'"
,
reg
->
name
);
err
=
1
;
break
;
}
else
{
if
(
*
exp_arg
!=
val
->
type
)
{
if
(
*
exp_arg
==
SVT_STRING_LIST
&&
val
->
type
==
SVT_STRING
)
{
list_t
list
;
list_create
(
&
list
);
list_append
(
list
,
val
->
v
.
string
);
sieve_pfree
(
&
sieve_machine
->
memory_pool
,
val
);
val
=
sieve_value_create
(
SVT_STRING_LIST
,
list
);
}
else
{
sieve_compile_error
(
sieve_filename
,
sieve_line_num
,
"type mismatch in argument %d to `%s'"
,
exp_arg
-
reg
->
req_args
+
1
,
reg
->
name
);
sieve_compile_error
(
sieve_filename
,
sieve_line_num
,
"Expected %s but passed %s"
,
sieve_type_str
(
*
exp_arg
),
sieve_type_str
(
val
->
type
));
err
=
1
;
break
;
}
}
if
(
!
arg_list
&&
(
rc
=
list_create
(
&
arg_list
)))
{
sieve_
error
(
"%s:%d: can't create arg list: %s"
,
sieve_filename
,
sieve_line_num
,
mu_errstring
(
rc
));
sieve_
compile_error
(
sieve_filename
,
sieve_line_num
,
"can't create arg list: %s"
,
mu_errstring
(
rc
));
err
=
1
;
break
;
}
...
...
@@ -211,9 +228,9 @@ sieve_code_command (sieve_register_t *reg, list_t arglist)
{
if
(
*
exp_arg
!=
SVT_VOID
)
{
sieve_
error
(
"%s:%d: too few arguments in call to `%s'"
,
sieve_filename
,
sieve_line_num
,
reg
->
name
);
sieve_
compile_error
(
sieve_filename
,
sieve_line_num
,
"too few arguments in call to `%s'"
,
reg
->
name
);
err
=
1
;
}
}
...
...
Please
register
or
sign in
to post a comment