Skip to content

Commit

Permalink
cfityk: fix handling not installed gnuplot
Browse files Browse the repository at this point in the history
  • Loading branch information
wojdyr committed Nov 8, 2016
1 parent 3f1b4c4 commit a2b7122
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cli/gnuplot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ void GnuPlot::fork_and_make_pipe()
//putenv("PAGER=");
execlp(GNUPLOT_PATH, GNUPLOT_PATH, /*"-",*/ NULL);
// if we are here, sth went wrong
fprintf(stderr,
"** Calling `" GNUPLOT_PATH "' failed. Plotting disabled. **");
exit(0); // terminate only the child process
fprintf(stderr, "** Calling `" GNUPLOT_PATH
"' failed. Plotting disabled. **\n");
abort(); // exit() messed with open files.
} else {
// Parent process closes up input side of pipe
close(fd[0]);
Expand All @@ -83,7 +83,7 @@ bool GnuPlot::test_gnuplot_pipe()
fprintf(gnuplot_pipe_, " "); //pipe test
fflush(gnuplot_pipe_);
if (errno != 0) // errno == EPIPE if the pipe doesn't work
failed_ = false;
failed_ = true;
return errno == 0;
#endif //_WIN32
}
Expand Down
2 changes: 0 additions & 2 deletions fityk/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,10 @@ class LineReader

char* return_buf(int n)
{
// we don't need '\n' at all
if (n > 0 && buf_[n-1] == '\n')
buf_[n-1] = '\0';
return n == -1 ? NULL : buf_;
}

};


Expand Down

0 comments on commit a2b7122

Please sign in to comment.