<<< Date Index >>>     <<< Thread Index >>>

Re: [ANNOUNCE] mutt 1.5.16 released



On 2007-06-13 18:03:15 -0400, Jean-Pierre Radley wrote:
> Vincent Lefevre typed (on Mon, Jun 11, 2007 at 03:13:44AM +0200):
> | > Otherwise, after composing a message and exiting the editor, one
> | > gets an error:
> | > 
> | >         Error running "/usr/bin/vi '/usr/tmp/mutt-jpradley-0-23020-1'"!
> | 
> | This is a problem with your editor.
> 
> Under Posix 2004 rules, I'm not sure what exit status vi will present,
> but the vi on all variants of Unix from SCO, as well as the vi on
> Solaris 10, adhere to the Posix 2001 standard, which includes in the
> clause 'consequences of errors' "... or when an error is detected that
> is a consequence of data (not) present in the file, ..." and "ex/vi
> shall terminate with a nonzero exit status."

A non-zero exit status has always meant an error. Now, what is regarded
as an error depends on the application.

> So on my Unix, or on Solaris 10, one will increment vi's exit status for
> each unsuccessful command, like failed pattern searches, out-of-bound
> line-moves, writes to an inexistent directory, etc.

If your vi regards something like a failed pattern search as an error,
you have to accept that. If you don't like it, either use another
editor or use a wrapper to modify the exit status.

Note that vi doesn't have this problem under Linux.

> What I suggested is to revert this change:
> 
>       2007-04-02 17:56 -0700  Brendan Cully  <brendan@xxxxxxxxxx>
>       (15f8a55220a7)
>        .....
>       * curs_lib.c: Make mutt_edit_file display error if editor
>       return is non-zero. (closes #1638)

If this is reverted, this may break the behavior with other editors
(that are conform to the standards).

In particular, the most portable way to terminate a C program
unsuccessfully is to return EXIT_FAILURE, which has the value 1
under Unix. So, if the above is reverted, then this means that
unsuccessful termination of such portable programs will not be
detected!

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)