]>
diplodocus.org Git - nmh/blob - sbr/geteditor.c
1 /* geteditor.c -- Determine the default editor to use
3 * This code is Copyright (c) 2013, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
10 #include "context_find.h"
13 static char *default_editor
= NULL
;
16 get_default_editor(void)
21 return default_editor
;
23 if (!(str
= context_find("editor")) && !(str
= getenv("VISUAL")) &&
24 !(str
= getenv("EDITOR"))) {
28 return default_editor
= str
;