From b033314bf1901d436dc71d41d5e1f37dda47e511 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Thu, 12 Dec 2024 16:03:08 +0100 Subject: formatting: Use clang-format on all projects This commit also add braces to all `if` statements. --- userland/minibox/utilities/sh/sh.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'userland/minibox/utilities/sh/sh.c') diff --git a/userland/minibox/utilities/sh/sh.c b/userland/minibox/utilities/sh/sh.c index b00b440..3643d99 100644 --- a/userland/minibox/utilities/sh/sh.c +++ b/userland/minibox/utilities/sh/sh.c @@ -68,8 +68,9 @@ int execute_binary(struct AST *ast, int input_fd) { } if (ast->pipe_rhs) { - if (out >= 0) + if (out >= 0) { close(out); + } return execute_command(ast->pipe_rhs, slave_input); } @@ -135,14 +136,16 @@ void execute_ast(struct AST *ast) { } else if (AST_CONDITIONAL_AND == ast->type) { if (0 != rc) { ast = ast->next; - if (!ast) + if (!ast) { break; + } } } else if (AST_CONDITIONAL_NOT == ast->type) { if (0 == rc) { ast = ast->next; - if (!ast) + if (!ast) { break; + } } } ast = ast->next; -- cgit v1.2.3