X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f67e3671c985ad8095dc6fcc8be7ba6dd25cdf63..3c751489b2aca846fe2305a6a3d189381579b61e:/sbr/geteditor.c diff --git a/sbr/geteditor.c b/sbr/geteditor.c index 6c285da9..a0071998 100644 --- a/sbr/geteditor.c +++ b/sbr/geteditor.c @@ -1,14 +1,14 @@ - -/* - * geteditor.c -- Determine the default editor to use +/* geteditor.c -- Determine the default editor to use * * This code is Copyright (c) 2013, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ -#include -#include +#include "h/mh.h" +#include "geteditor.h" +#include "context_find.h" +#include "h/utils.h" static char *default_editor = NULL; @@ -18,12 +18,12 @@ get_default_editor(void) char *str; if (default_editor) - return default_editor; + return default_editor; if (!(str = context_find("editor")) && !(str = getenv("VISUAL")) && - !(str = getenv("EDITOR"))) { - str = DEFAULT_EDITOR; + !(str = getenv("EDITOR"))) { + str = "prompter"; } - return (default_editor = str); + return default_editor = str; }