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
affc8db6
...
affc8db69ec43022682647a1b133d162fc241eb8
authored
2002-03-14 09:46:34 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(util_do_command): Coredumped in false branches of `if ... endif' statement. Fixed.
1 parent
7d482dfb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
mail/util.c
mail/util.c
View file @
affc8db
...
...
@@ -83,6 +83,7 @@ util_do_command (const char *c, ...)
char
**
argv
=
NULL
;
int
status
=
0
;
function_t
*
command
;
int
exec
=
1
;
char
*
cmd
=
NULL
;
va_list
ap
;
static
const
char
*
delim
=
"="
;
...
...
@@ -95,29 +96,29 @@ util_do_command (const char *c, ...)
if
(
cmd
)
{
struct
mail_command_entry
entry
;
/* Ignore comments */
if
(
cmd
[
0
]
==
'#'
)
{
if
(
cmd
[
0
]
==
'#'
)
{
free
(
cmd
);
return
0
;
}
/* Hitting return i.e. no command, is equivalent to next
according to the POSIX spec. */
if
(
cmd
[
0
]
==
'\0'
)
{
if
(
cmd
[
0
]
==
'\0'
)
{
free
(
cmd
);
cmd
=
strdup
(
"next"
);
}
if
(
argcv_get
(
cmd
,
delim
,
NULL
,
&
argc
,
&
argv
)
==
0
)
{
struct
mail_command_entry
entry
;
entry
=
util_find_entry
(
mail_command_table
,
argv
[
0
]);
/* Make sure we are not in any if/else */
if
(
!
(
if_cond
()
==
0
&&
(
entry
.
flags
&
EF_FLOW
)
==
0
))
command
=
entry
.
func
;
/* Make sure we are not in any if/else */
exec
=
!
(
if_cond
()
==
0
&&
(
entry
.
flags
&
EF_FLOW
)
==
0
);
}
free
(
cmd
);
}
...
...
@@ -125,10 +126,13 @@ util_do_command (const char *c, ...)
command
=
util_command_get
(
"quit"
);
if
(
command
!=
NULL
)
{
if
(
exec
)
status
=
command
(
argc
,
argv
);
}
else
{
util_error
(
"Unknown command: %s"
,
argv
[
0
]);
util_error
(
"Unknown command: %s"
,
argv
[
0
]);
status
=
1
;
}
...
...
Please
register
or
sign in
to post a comment