Re: Viewer warns about absent catdoc&word2x _before_ exit for zzz.doc with zzz.doc inside



Hello!

> Andrew W. Nosenko <awn bcs zp ua> reported strange bug with files named 
> like zzz.doc with only zzz.doc line inside. There is Linux box without 
> catdoc & word2x:
> $ echo zzz.doc > zzz.doc
> F3 zzz.doc
> zzz.doc is showed ok in the viewer.
> F10, F3, q, etc -- and warning window with message about absent catdoc 
> and word2x appears.

I'm not surprized.  check_error_pipe() was broken for a long time.  Now 
it's fixed, so that the messages have become visible, and we can see how 
wrong they are :-)

check_error_pipe() is called very late in the viewer - it's called in 
free_file(), when the viewer exits.

We need something like this:

=========================
--- view.c
+++ view.c
@@ -461,6 +461,7 @@ init_growing_view (WView * view, char *n
 		err_msg = (" Empty output from child filter ");
 	    return set_view_init_error (view, err_msg);
 	}
+	check_error_pipe ();
     } else {
 	view->stdfile = NULL;
 	if ((view->file = mc_open (filename, O_RDONLY)) == -1)
=========================

I tried this, and there is another empty warning on exit from the viewer.  
I don't have time to finish it today (although I often do something after
saying that I cannot :-)), and I'll be away on weekend.

Incidentally, I think that the *_error_pipe mechanism will be useful in
vfs/extfs.c, which also uses popen().  It's better than to see rpm or zip
warnings all over the screen.  but it means that we should do it right and
make empty warnings impossible.

-- 
Regards,
Pavel Roskin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]