Skip to content

Commit

Permalink
Windows: curv -le works, without setting CURV_EDITOR
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-moen committed Jul 15, 2020
1 parent 23ad34a commit 45a152f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion curv/curv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ main(int argc, char** argv)
break;
case 'e':
editor = getenv("CURV_EDITOR");
if (editor == nullptr)
if (editor == nullptr || *editor == '\0')
{
#ifdef _WIN32
editor = "notepad";
Expand Down
4 changes: 3 additions & 1 deletion curv/livemode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ launch_editor(const char* editor, const char* filename)
if (!createProcessSuccess)
{
DWORD error = GetLastError();
throw curv::Exception_Base(curv::stringify("Could not launch editor: ", curv::win_strerror(error)));
throw curv::Exception_Base(curv::stringify(
"Could not launch editor (", editor_commandline, "): ",
curv::win_strerror(error)));
}

// Close this handle right away as we only need proc_info.hProcess in poll_editor()
Expand Down

0 comments on commit 45a152f

Please sign in to comment.