* view.c (init_growing_view): Avoid reporting the same error
twice. Reported by Moritz Barsnick <moritz@barsnick.net>
Этот коммит содержится в:
родитель
15098a5cd1
Коммит
d2c8d076f9
@ -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>
|
2002-09-07 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* textconf.c: Don't use SLANG_TERMINFO, which is unused anywhere
|
* textconf.c: Don't use SLANG_TERMINFO, which is unused anywhere
|
||||||
|
14
src/view.c
14
src/view.c
@ -442,6 +442,8 @@ set_view_init_error (WView *view, char *msg)
|
|||||||
static char *
|
static char *
|
||||||
init_growing_view (WView * view, char *name, char *filename)
|
init_growing_view (WView * view, char *name, char *filename)
|
||||||
{
|
{
|
||||||
|
char *err_msg = NULL;
|
||||||
|
|
||||||
view->growing_buffer = 1;
|
view->growing_buffer = 1;
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
@ -450,8 +452,10 @@ init_growing_view (WView *view, char *name, char *filename)
|
|||||||
|
|
||||||
open_error_pipe ();
|
open_error_pipe ();
|
||||||
if ((view->stdfile = popen (name, "r")) == NULL) {
|
if ((view->stdfile = popen (name, "r")) == NULL) {
|
||||||
close_error_pipe (view->have_frame?-1:1, view->data);
|
/* Avoid two messages. Message from stderr has priority. */
|
||||||
return set_view_init_error (view, _(" Cannot spawn child program "));
|
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 */
|
/* 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) {
|
if (view->bytes_read <= 0) {
|
||||||
pclose (view->stdfile);
|
pclose (view->stdfile);
|
||||||
view->stdfile = NULL;
|
view->stdfile = NULL;
|
||||||
close_error_pipe (view->have_frame?-1:1, view->data);
|
/* Avoid two messages. Message from stderr has priority. */
|
||||||
return set_view_init_error (view, _(" Empty output from child filter "));
|
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 {
|
} else {
|
||||||
view->stdfile = NULL;
|
view->stdfile = NULL;
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user