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
588c6a16
...
588c6a16cad7c748388fc7ab096782561d4ea5f9
authored
2003-01-15 17:31:43 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mh_spawnp): New function.
1 parent
7026c149
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
mh/mh_init.c
mh/mh_init.c
View file @
588c6a1
...
...
@@ -379,3 +379,37 @@ mh_iterate (mailbox_t mbox, mh_msgset_t *msgset,
return
0
;
}
int
mh_spawnp
(
const
char
*
prog
,
const
char
*
file
)
{
int
argc
,
i
,
rc
,
status
;
char
**
argv
,
**
xargv
;
if
(
argcv_get
(
prog
,
""
,
"#"
,
&
argc
,
&
argv
))
{
mh_error
(
_
(
"cannot split line %s"
),
prog
);
argcv_free
(
argc
,
argv
);
return
1
;
}
xargv
=
calloc
(
argc
+
2
,
sizeof
(
*
xargv
));
if
(
!
xargv
)
{
mh_error
(
_
(
"not enough memory"
));
argcv_free
(
argc
,
argv
);
return
1
;
}
for
(
i
=
0
;
i
<
argc
;
i
++
)
xargv
[
i
]
=
argv
[
i
];
xargv
[
i
++
]
=
(
char
*
)
file
;
xargv
[
i
++
]
=
NULL
;
rc
=
mu_spawnvp
(
xargv
[
0
],
(
const
char
**
)
xargv
,
&
status
);
free
(
xargv
);
argcv_free
(
argc
,
argv
);
return
rc
;
}
...
...
Please
register
or
sign in
to post a comment