diff --git a/src/builtin_string.cpp b/src/builtin_string.cpp index 09ca8b970..b97effcac 100644 --- a/src/builtin_string.cpp +++ b/src/builtin_string.cpp @@ -1147,7 +1147,7 @@ static int string_split_maybe0(parser_t &parser, io_streams_t &streams, int argc if (retval != STATUS_CMD_OK) return retval; if (opts.fields.size() < 1 && opts.allow_empty) { - streams.err.append_format(BUILTIN_ERR_COMBO2, cmd, + streams.err.append_format(BUILTIN_ERR_COMBO2, cmd, _(L"--allow-empty is only valid with --fields")); return STATUS_INVALID_ARGS; } diff --git a/src/exec.cpp b/src/exec.cpp index 30c831f00..0d2291c42 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -87,9 +87,8 @@ pgroup_provenance_t get_pgroup_provenance(const shared_ptr &j, /// This function is executed by the child process created by a call to fork(). It should be called /// after \c child_setup_process. It calls execve to replace the fish process image with the command /// specified in \c p. It never returns. Called in a forked child! Do not allocate memory, etc. -[[noreturn]] -static void safe_launch_process(process_t *p, const char *actual_cmd, const char *const *cargv, - const char *const *cenvv) { +[[noreturn]] static void safe_launch_process(process_t *p, const char *actual_cmd, + const char *const *cargv, const char *const *cenvv) { UNUSED(p); int err; @@ -133,8 +132,7 @@ static void safe_launch_process(process_t *p, const char *actual_cmd, const char /// This function is similar to launch_process, except it is not called after a fork (i.e. it only /// calls exec) and therefore it can allocate memory. -[[noreturn]] -static void launch_process_nofork(env_stack_t &vars, process_t *p) { +[[noreturn]] static void launch_process_nofork(env_stack_t &vars, process_t *p) { ASSERT_IS_MAIN_THREAD(); ASSERT_IS_NOT_FORKED_CHILD(); @@ -349,7 +347,8 @@ static bool fork_child_for_process(const std::shared_ptr &job, process_t maybe_t new_termowner{}; p->pid = getpid(); child_set_group(job.get(), p); - child_setup_process(job->should_claim_terminal() ? job->pgid : INVALID_PID, *job, true, dup2s); + child_setup_process(job->should_claim_terminal() ? job->pgid : INVALID_PID, *job, true, + dup2s); child_action(); DIE("Child process returned control to fork_child lambda!"); } diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp index f3bef3ecc..2ecaa5756 100644 --- a/src/fish_key_reader.cpp +++ b/src/fish_key_reader.cpp @@ -242,8 +242,7 @@ static void process_input(bool continuous_mode) { } /// Setup our environment (e.g., tty modes), process key strokes, then reset the environment. -[[noreturn]] -static void setup_and_process_keys(bool continuous_mode) { +[[noreturn]] static void setup_and_process_keys(bool continuous_mode) { set_interactive_session(session_interactivity_t::implied); set_main_thread(); setup_fork_guards(); diff --git a/src/fish_test_helper.cpp b/src/fish_test_helper.cpp index afb0b94ed..960cdaa3d 100644 --- a/src/fish_test_helper.cpp +++ b/src/fish_test_helper.cpp @@ -77,8 +77,9 @@ static void print_blocked_signals() { exit(EXIT_FAILURE); } // There is no obviously portable way to get the maximum number of signals. - // Here we limit it to 64 because strsignal on Linux returns "Unknown signal" for anything above. - for (int sig=1; sig < 65; sig++) { + // Here we limit it to 64 because strsignal on Linux returns "Unknown signal" for anything + // above. + for (int sig = 1; sig < 65; sig++) { if (sigismember(&sigs, sig)) { if (const char *s = strsignal(sig)) { fprintf(stderr, "%s", s); @@ -115,7 +116,8 @@ static fth_command_t s_commands[] = { {"print_pid_then_sleep", print_pid_then_sleep, "Print our pid, then sleep for .5 seconds"}, {"print_pgrp", print_pgrp, "Print our pgroup to stdout"}, {"print_fds", print_fds, "Print the list of active FDs to stdout"}, - {"print_blocked_signals", print_blocked_signals, "Print to stdout the name(s) of blocked signals"}, + {"print_blocked_signals", print_blocked_signals, + "Print to stdout the name(s) of blocked signals"}, {"help", show_help, "Print list of fish_test_helper commands"}, }; diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 8312d12d5..70a5af99c 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -3229,8 +3229,10 @@ static void test_autosuggest_suggest_special() { // Don't crash on ~ (issue #2696). Note this is cwd dependent. if (system("mkdir -p '~absolutelynosuchuser/path1/path2/'")) err(L"mkdir failed"); - perform_one_autosuggestion_cd_test(L"cd ~absolutelynosuchus", L"er/path1/path2/", vars, __LINE__); - perform_one_autosuggestion_cd_test(L"cd ~absolutelynosuchuser/", L"path1/path2/", vars, __LINE__); + perform_one_autosuggestion_cd_test(L"cd ~absolutelynosuchus", L"er/path1/path2/", vars, + __LINE__); + perform_one_autosuggestion_cd_test(L"cd ~absolutelynosuchuser/", L"path1/path2/", vars, + __LINE__); perform_one_completion_cd_test(L"cd ~absolutelynosuchus", L"er/", vars, __LINE__); perform_one_completion_cd_test(L"cd ~absolutelynosuchuser/", L"path1/", vars, __LINE__); diff --git a/src/postfork.cpp b/src/postfork.cpp index 42101f208..29990a16d 100644 --- a/src/postfork.cpp +++ b/src/postfork.cpp @@ -135,7 +135,8 @@ bool set_child_group(job_t *j, pid_t child_pid) { return true; } -int child_setup_process(pid_t new_termowner, const job_t &job, bool is_forked, const dup2_list_t &dup2s) { +int child_setup_process(pid_t new_termowner, const job_t &job, bool is_forked, + const dup2_list_t &dup2s) { // Note we are called in a forked child. for (const auto &act : dup2s.get_actions()) { int err; diff --git a/src/postfork.h b/src/postfork.h index 2e7abc47b..a93fa31df 100644 --- a/src/postfork.h +++ b/src/postfork.h @@ -31,7 +31,8 @@ bool child_set_group(job_t *j, process_t *p); // called by child /// /// \return 0 on success, -1 on failure. When this function returns, signals are always unblocked. /// On failure, signal handlers, io redirections and process group of the process is undefined. -int child_setup_process(pid_t new_termowner, const job_t &job, bool is_forked, const dup2_list_t &dup2s); +int child_setup_process(pid_t new_termowner, const job_t &job, bool is_forked, + const dup2_list_t &dup2s); /// Call fork(), retrying on failure a few times. pid_t execute_fork(); diff --git a/src/proc.cpp b/src/proc.cpp index d55aab54e..f839695b8 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -436,9 +436,9 @@ static void process_mark_finished_children(parser_t &parser, bool block_ok) { proc->argv0(), pid, proc->status.status_value()); } else { assert(proc->status.stopped() || proc->status.continued()); - FLOGF(proc_reap_external, - "External process '%ls' (pid %d, %s)", - proc->argv0(), pid, proc->status.stopped() ? "stopped" : "continued"); + FLOGF(proc_reap_external, "External process '%ls' (pid %d, %s)", + proc->argv0(), pid, + proc->status.stopped() ? "stopped" : "continued"); } } } else { diff --git a/src/reader.cpp b/src/reader.cpp index ed894f967..b05a67bf4 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -2735,8 +2735,8 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat cycle_cursor_pos = token_end - buff; bool cont_after_prefix_insertion = (c == rl::complete_and_search); - rls.complete_did_insert = handle_completions(rls.comp, token_begin - buff, token_end - buff, - cont_after_prefix_insertion); + rls.complete_did_insert = handle_completions( + rls.comp, token_begin - buff, token_end - buff, cont_after_prefix_insertion); // Show the search field if requested and if we printed a list of completions. if (c == rl::complete_and_search && !rls.complete_did_insert && !pager.empty()) {