diff --git a/builtin_test.cpp b/builtin_test.cpp index 0d16823af..a2045cc4b 100644 --- a/builtin_test.cpp +++ b/builtin_test.cpp @@ -652,7 +652,6 @@ expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err) err.append(L"test: "); err.append(parser.errors.at(i)); err.push_back(L'\n'); - errored = true; // For now we only show the first error break; } @@ -667,7 +666,6 @@ expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err) { append_format(err, L"test: unexpected argument at index %lu: '%ls'\n", (unsigned long)result->range.end, args.at(result->range.end).c_str()); } - errored = true; delete result; result = NULL; diff --git a/common.cpp b/common.cpp index 08e8d7a1f..7434c31d9 100644 --- a/common.cpp +++ b/common.cpp @@ -866,11 +866,7 @@ void write_screen(const wcstring &msg, wcstring &buff) /* If token is zero character long, we don't do anything */ - if (pos == start) - { - start = pos = pos+1; - } - else if (overflow) + if (overflow) { /* In case of overflow, we print a newline, except if we already are at position 0 diff --git a/fish.cpp b/fish.cpp index 35b641ee0..53262929b 100644 --- a/fish.cpp +++ b/fish.cpp @@ -213,8 +213,6 @@ static struct config_paths_t determine_config_directory_paths(const char *argv0) paths.sysconf = L"" SYSCONFDIR "/fish"; paths.doc = L"" DOCDIR; paths.bin = L"" BINDIR; - - done = true; } return paths; diff --git a/history.cpp b/history.cpp index f8183f5d8..0c7bc6184 100644 --- a/history.cpp +++ b/history.cpp @@ -1338,7 +1338,7 @@ bool history_t::save_internal_via_rewrite() for (size_t attempt = 0; attempt < 10 && out_fd == -1; attempt++) { char *narrow_str = wcs2str(tmp_name_template.c_str()); - if (narrow_str && mktemp(narrow_str)) + if (narrow_str && mkstemp(narrow_str)) { /* It was successfully templated; try opening it atomically */ tmp_name = str2wcstring(narrow_str); @@ -1507,11 +1507,6 @@ void history_t::save_internal(bool vacuum) /* Try doing a fast append */ ok = save_internal_via_appending(); } - if (! ok) - { - /* We did not or could not append; rewrite the file ("vacuum" it) */ - ok = this->save_internal_via_rewrite(); - } } void history_t::save(void) diff --git a/pager.cpp b/pager.cpp index b137bca2f..0fa7eb4c7 100644 --- a/pager.cpp +++ b/pager.cpp @@ -147,7 +147,6 @@ line_t pager_t::completion_print_item(const wcstring &prefix, const comp_t *c, s } written += print_max(L"(", packed_color, 1, false, &line_data); written += print_max(c->desc, packed_color, desc_width, false, &line_data); - written += print_max(L")", packed_color, 1, false, &line_data); } else { @@ -635,7 +634,6 @@ bool pager_t::completion_try_print(size_t cols, const wcstring &prefix, const co /* We limit the width to term_width - 1 */ int search_field_written = print_max(SEARCH_FIELD_PROMPT, highlight_spec_normal, term_width - 1, false, search_field); - search_field_written += print_max(search_field_text, highlight_modifier_force_underline, term_width - search_field_written - 1, false, search_field); } } @@ -747,7 +745,7 @@ bool pager_t::select_next_completion_in_direction(selection_direction_t directio } /* Ok, we had something selected already. Select something different. */ - size_t new_selected_completion_idx = selected_completion_idx; + size_t new_selected_completion_idx; if (! selection_direction_is_cardinal(direction)) { /* Next, previous, or deselect, all easy */ diff --git a/parse_execution.cpp b/parse_execution.cpp index 726f29207..d57b8e7ec 100644 --- a/parse_execution.cpp +++ b/parse_execution.cpp @@ -532,7 +532,6 @@ parse_execution_result_t parse_execution_context_t::run_switch_statement(const p { /* Store the node that failed to expand */ report_error(switch_value_node, WILDCARD_ERR_MSG, switch_value.c_str()); - ret = parse_execution_errored; break; } diff --git a/parse_tree.cpp b/parse_tree.cpp index 484b79687..eb139e633 100644 --- a/parse_tree.cpp +++ b/parse_tree.cpp @@ -987,7 +987,6 @@ void parse_ll_t::accept_tokens(parse_token_t token1, parse_token_t token2) { fprintf(stderr, "Consumed token %ls\n", token1.describe().c_str()); } - consumed = true; break; } diff --git a/parser.cpp b/parser.cpp index 0a4f004ae..9435d3d12 100644 --- a/parser.cpp +++ b/parser.cpp @@ -2592,10 +2592,6 @@ int parser_t::eval_new_parser(const wcstring &cmd, const io_chain_t &io, enum bl /* Execute the first node */ int result = 1; - if (! tree.empty()) - { - result = this->eval_block_node(0, io, block_type); - } /* Clean up the execution context stack */ assert(! execution_contexts.empty() && execution_contexts.back() == ctx); diff --git a/proc.cpp b/proc.cpp index 2ea0d1bd4..9c66292dc 100644 --- a/proc.cpp +++ b/proc.cpp @@ -398,7 +398,6 @@ static void mark_process_status(const job_t *j, process_t *p, int status) handler. If things aren't working properly, it's safer to give up. */ - ignore = write(2, mess, strlen(mess)); } }