1
1

* view.c (init_growing_view): Avoid reporting the same error

twice.  Reported by Moritz Barsnick <moritz@barsnick.net>
Этот коммит содержится в:
Pavel Roskin 2002-09-08 15:22:28 +00:00
родитель 15098a5cd1
Коммит d2c8d076f9
2 изменённых файлов: 20 добавлений и 9 удалений

Просмотреть файл

@ -1,3 +1,8 @@
2002-09-08 Pavel Roskin <proski@gnu.org>
* view.c (init_growing_view): Avoid reporting the same error
twice. Reported by Moritz Barsnick <moritz@barsnick.net>
2002-09-07 Pavel Roskin <proski@gnu.org>
* textconf.c: Don't use SLANG_TERMINFO, which is unused anywhere

Просмотреть файл

@ -442,6 +442,8 @@ set_view_init_error (WView *view, char *msg)
static char *
init_growing_view (WView * view, char *name, char *filename)
{
char *err_msg = NULL;
view->growing_buffer = 1;
if (name) {
@ -450,8 +452,10 @@ init_growing_view (WView *view, char *name, char *filename)
open_error_pipe ();
if ((view->stdfile = popen (name, "r")) == NULL) {
close_error_pipe (view->have_frame?-1:1, view->data);
return set_view_init_error (view, _(" Cannot spawn child program "));
/* Avoid two messages. Message from stderr has priority. */
if (!close_error_pipe (view->have_frame ? -1 : 1, view->data))
err_msg = _(" Cannot spawn child program ");
return set_view_init_error (view, err_msg);
}
/* First, check if filter produced any output */
@ -459,8 +463,10 @@ init_growing_view (WView *view, char *name, char *filename)
if (view->bytes_read <= 0) {
pclose (view->stdfile);
view->stdfile = NULL;
close_error_pipe (view->have_frame?-1:1, view->data);
return set_view_init_error (view, _(" Empty output from child filter "));
/* Avoid two messages. Message from stderr has priority. */
if (!close_error_pipe (view->have_frame ? -1 : 1, view->data))
err_msg = (" Empty output from child filter ");
return set_view_init_error (view, err_msg);
}
} else {
view->stdfile = NULL;