Cleanup after logging command
This commit is contained in:
2
gebs.h
2
gebs.h
@ -418,6 +418,7 @@ char *gebs_cwd(void);
|
|||||||
int gebs_cmd_run_sync_alloc(Gebs_Allocator *alloc, Gebs_Cmd *cmd)
|
int gebs_cmd_run_sync_alloc(Gebs_Allocator *alloc, Gebs_Cmd *cmd)
|
||||||
{
|
{
|
||||||
Gebs_String_Builder sb = {0};
|
Gebs_String_Builder sb = {0};
|
||||||
|
defer { gebs_sb_free_alloc(alloc, &sb); }
|
||||||
gebs_nsl_join_alloc(alloc, cmd, &sb, " ");
|
gebs_nsl_join_alloc(alloc, cmd, &sb, " ");
|
||||||
gebs_sb_finish_alloc(alloc, &sb);
|
gebs_sb_finish_alloc(alloc, &sb);
|
||||||
GEBS_LOGI("cmd `%s`\n", sb.items);
|
GEBS_LOGI("cmd `%s`\n", sb.items);
|
||||||
@ -462,6 +463,7 @@ int gebs_cmd_run_sync_alloc(Gebs_Allocator *alloc, Gebs_Cmd *cmd)
|
|||||||
int gebs_cmd_run_sync_collect_alloc(Gebs_Allocator *alloc, Gebs_Cmd *cmd, Gebs_String_Builder *sb_out)
|
int gebs_cmd_run_sync_collect_alloc(Gebs_Allocator *alloc, Gebs_Cmd *cmd, Gebs_String_Builder *sb_out)
|
||||||
{
|
{
|
||||||
Gebs_String_Builder sb = {0};
|
Gebs_String_Builder sb = {0};
|
||||||
|
defer { gebs_sb_free_alloc(alloc, &sb); }
|
||||||
gebs_nsl_join_alloc(alloc, cmd, &sb, " ");
|
gebs_nsl_join_alloc(alloc, cmd, &sb, " ");
|
||||||
gebs_sb_finish_alloc(alloc, &sb);
|
gebs_sb_finish_alloc(alloc, &sb);
|
||||||
GEBS_LOGI("cmd `%s`\n", sb.items);
|
GEBS_LOGI("cmd `%s`\n", sb.items);
|
||||||
|
Reference in New Issue
Block a user