|
From: | Paul Vixie |
Subject: | Re: [nmh-workers] Unnecessary dependency on vi??? |
Date: | Tue, 20 Mar 2018 13:24:17 -0700 |
User-agent: | Postbox 5.0.24 (Windows/20180302) |
Andy Bradford wrote:
Thus said Ralph Corderoy on Tue, 20 Mar 2018 12:56:09 -0000:For evermore, programs that only offer one means of invoking an editor have had to checking first $VISUAL, falling back to $EDITOR. :-)You mean like the following chunk of code: :-) http://www.fossil-scm.org/index.html/artifact?udc=1&ln=1180-1186+1196-1204&name=8d7c320c6bbe086b
here's how crontab(1) does it:
/* what editor to use if no EDITOR or VISUAL * environment variable specified. */ #if defined(_PATH_VI) # define EDITOR _PATH_VI #else # define EDITOR "/usr/ucb/vi" #endif ... if (((editor = getenv("VISUAL")) == NULL || *editor == '\0') && ((editor = getenv("EDITOR")) == NULL || *editor == '\0')) { editor = EDITOR; }
-- P Vixie
[Prev in Thread] | Current Thread | [Next in Thread] |