mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Dead stores
This commit is contained in:
parent
6d749789ce
commit
ddcd2b0810
9 changed files with 3 additions and 25 deletions
|
@ -652,7 +652,6 @@ expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err)
|
||||||
err.append(L"test: ");
|
err.append(L"test: ");
|
||||||
err.append(parser.errors.at(i));
|
err.append(parser.errors.at(i));
|
||||||
err.push_back(L'\n');
|
err.push_back(L'\n');
|
||||||
errored = true;
|
|
||||||
// For now we only show the first error
|
// For now we only show the first error
|
||||||
break;
|
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());
|
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;
|
delete result;
|
||||||
result = NULL;
|
result = NULL;
|
||||||
|
|
|
@ -866,11 +866,7 @@ void write_screen(const wcstring &msg, wcstring &buff)
|
||||||
/*
|
/*
|
||||||
If token is zero character long, we don't do anything
|
If token is zero character long, we don't do anything
|
||||||
*/
|
*/
|
||||||
if (pos == start)
|
if (overflow)
|
||||||
{
|
|
||||||
start = pos = pos+1;
|
|
||||||
}
|
|
||||||
else if (overflow)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
In case of overflow, we print a newline, except if we already are at position 0
|
In case of overflow, we print a newline, except if we already are at position 0
|
||||||
|
|
2
fish.cpp
2
fish.cpp
|
@ -213,8 +213,6 @@ static struct config_paths_t determine_config_directory_paths(const char *argv0)
|
||||||
paths.sysconf = L"" SYSCONFDIR "/fish";
|
paths.sysconf = L"" SYSCONFDIR "/fish";
|
||||||
paths.doc = L"" DOCDIR;
|
paths.doc = L"" DOCDIR;
|
||||||
paths.bin = L"" BINDIR;
|
paths.bin = L"" BINDIR;
|
||||||
|
|
||||||
done = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return paths;
|
return paths;
|
||||||
|
|
|
@ -1338,7 +1338,7 @@ bool history_t::save_internal_via_rewrite()
|
||||||
for (size_t attempt = 0; attempt < 10 && out_fd == -1; attempt++)
|
for (size_t attempt = 0; attempt < 10 && out_fd == -1; attempt++)
|
||||||
{
|
{
|
||||||
char *narrow_str = wcs2str(tmp_name_template.c_str());
|
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 */
|
/* It was successfully templated; try opening it atomically */
|
||||||
tmp_name = str2wcstring(narrow_str);
|
tmp_name = str2wcstring(narrow_str);
|
||||||
|
@ -1507,11 +1507,6 @@ void history_t::save_internal(bool vacuum)
|
||||||
/* Try doing a fast append */
|
/* Try doing a fast append */
|
||||||
ok = save_internal_via_appending();
|
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)
|
void history_t::save(void)
|
||||||
|
|
|
@ -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(L"(", packed_color, 1, false, &line_data);
|
||||||
written += print_max(c->desc, packed_color, desc_width, 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
|
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 */
|
/* 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);
|
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. */
|
/* 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))
|
if (! selection_direction_is_cardinal(direction))
|
||||||
{
|
{
|
||||||
/* Next, previous, or deselect, all easy */
|
/* Next, previous, or deselect, all easy */
|
||||||
|
|
|
@ -532,7 +532,6 @@ parse_execution_result_t parse_execution_context_t::run_switch_statement(const p
|
||||||
{
|
{
|
||||||
/* Store the node that failed to expand */
|
/* Store the node that failed to expand */
|
||||||
report_error(switch_value_node, WILDCARD_ERR_MSG, switch_value.c_str());
|
report_error(switch_value_node, WILDCARD_ERR_MSG, switch_value.c_str());
|
||||||
ret = parse_execution_errored;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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());
|
fprintf(stderr, "Consumed token %ls\n", token1.describe().c_str());
|
||||||
}
|
}
|
||||||
consumed = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2592,10 +2592,6 @@ int parser_t::eval_new_parser(const wcstring &cmd, const io_chain_t &io, enum bl
|
||||||
|
|
||||||
/* Execute the first node */
|
/* Execute the first node */
|
||||||
int result = 1;
|
int result = 1;
|
||||||
if (! tree.empty())
|
|
||||||
{
|
|
||||||
result = this->eval_block_node(0, io, block_type);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clean up the execution context stack */
|
/* Clean up the execution context stack */
|
||||||
assert(! execution_contexts.empty() && execution_contexts.back() == ctx);
|
assert(! execution_contexts.empty() && execution_contexts.back() == ctx);
|
||||||
|
|
1
proc.cpp
1
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
|
handler. If things aren't working properly, it's safer to
|
||||||
give up.
|
give up.
|
||||||
*/
|
*/
|
||||||
ignore = write(2, mess, strlen(mess));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue