Skip to content

Commit

Permalink
Remove invalid_filename goto
Browse files Browse the repository at this point in the history
Part of chjj#15
  • Loading branch information
Tyriar committed Jul 7, 2017
1 parent 90e0c70 commit 7144d71
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/win/pty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ static NAN_METHOD(PtyStartProcess) {
std::string shellpath_(shellpath.begin(), shellpath.end());

if(shellpath.empty() || !file_exists(shellpath)) {
goto invalid_filename;
why << "File not found: " << shellpath_;
Nan::ThrowError(why.str().c_str());
goto cleanup;
}

goto open;
Expand Down Expand Up @@ -252,11 +254,6 @@ static NAN_METHOD(PtyStartProcess) {

goto cleanup;

invalid_filename:
why << "File not found: " << shellpath_;
Nan::ThrowError(why.str().c_str());
goto cleanup;

cleanup:
delete filename;
delete cmdline;
Expand Down

0 comments on commit 7144d71

Please sign in to comment.