fix handling of empty read history session ID

This commit is contained in:
Kurtis Rader 2017-07-01 13:23:24 -07:00
parent c6093ad782
commit 68f4e005e4
2 changed files with 3 additions and 3 deletions

View File

@ -177,8 +177,10 @@ static int read_interactive(wcstring &buff, int nchars, bool shell, bool silent,
int exit_res = STATUS_CMD_OK; int exit_res = STATUS_CMD_OK;
const wchar_t *line; const wchar_t *line;
wcstring read_history_ID = history_session_id() + L"_read"; wcstring read_history_ID = history_session_id();
if (!read_history_ID.empty()) read_history_ID += L"_read";
reader_push(read_history_ID.c_str()); reader_push(read_history_ID.c_str());
reader_set_left_prompt(prompt); reader_set_left_prompt(prompt);
reader_set_right_prompt(right_prompt); reader_set_right_prompt(right_prompt);
if (shell) { if (shell) {

View File

@ -1008,8 +1008,6 @@ void exec_job(parser_t &parser, job_t *j) {
std::string actual_cmd_str = wcs2string(p->actual_cmd); std::string actual_cmd_str = wcs2string(p->actual_cmd);
const char *actual_cmd = actual_cmd_str.c_str(); const char *actual_cmd = actual_cmd_str.c_str();
const wchar_t *reader_current_filename(void);
const wchar_t *file = reader_current_filename(); const wchar_t *file = reader_current_filename();
#if FISH_USE_POSIX_SPAWN #if FISH_USE_POSIX_SPAWN