mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 14:06:21 +00:00
Create call_external() helper function
This commit is contained in:
13
src/common.c
13
src/common.c
@@ -483,3 +483,16 @@ get_mentions(gboolean whole_word, gboolean case_sensitive, const char *const mes
|
||||
|
||||
return mentions;
|
||||
}
|
||||
|
||||
void
|
||||
call_external(const char *const exe, const char *const param)
|
||||
{
|
||||
GString *cmd = g_string_new("");
|
||||
|
||||
g_string_append_printf(cmd, "%s %s > /dev/null 2>&1", exe, param);
|
||||
log_debug("Calling external: %s", cmd->str);
|
||||
FILE *stream = popen(cmd->str, "r");
|
||||
|
||||
pclose(stream);
|
||||
g_string_free(cmd, TRUE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user