[comp.mail.elm] elm aborts when vi returns non-zero during composition

mdv@comtst.UUCP (Mike Verstegen) (07/17/90)

As a very new elm user (compiled it yesterday), I've experienced a problem
with using vi in the composition mode during sending mail.

elm invokes the editor in editmsg.c with a system call and then looks at the
return value from the system call for a zero exit status. Unfortunately, vi
exits with the number of "errors" encountered during the editing session
(such as searching for a non-existent pattern). elm then sees the non-zero
exit status and aborts.

Being a new user, I don't want to blame the code, but it seems that vi is
fairly popular and I recall hearing that the non-zero exit value of vi is
fairly well known. Am I missing something here, or should I just hack the
module and forget about it?

Specifics:
	elm		 2.3 PL0 on AT&T 3B2/600
	vi:		 /usr/bin/vi.sl 1.26 3.1 10/13/86 62466 AT&T-SF
	System:		Unix V.3.1.1 on 3B2/600

Thanks in advance,

Mike Verstegen
uunet!comtst!mdv

dwatts@ki.UUCP (Dan Watts) (07/18/90)

In article <138@comtst.UUCP> mdv@comtst.UUCP (Mike Verstegen) writes:
>As a very new elm user (compiled it yesterday), I've experienced a problem
>with using vi in the composition mode during sending mail.
>
>elm invokes the editor in editmsg.c with a system call and then looks at the
>return value from the system call for a zero exit status. Unfortunately, vi
>exits with the number of "errors" encountered during the editing session
>(such as searching for a non-existent pattern). elm then sees the non-zero
>exit status and aborts.
> ... stuff deleted ...
>Mike Verstegen
>uunet!comtst!mdv

I too ran into the same problem on my SGI 3.2 system running the same
version of elm (Elm 2.3 PL0, of May 1, 1990).  I ended up defining the
symbol WEXITSTATUS() in config.h to make it work correctly.  My
definition was:

#define WEXITSTATUS(x)  ((x) & 0xFF)

and that made it work just fine.  Perhaps the configuration script should
ask about using WEXITSTATUS?
-- 
#####################################################################
# CompuServe: >INTERNET:uunet.UU.NET!ki!dwatts    Dan Watts         #
# UUCP      : ...!uunet!ki!dwatts                 Ki Research, Inc. #
############### New Dimensions In Network Connectivity ##############