aboutsummaryrefslogtreecommitdiffstats
path: root/src/vars.c
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2017-09-06 15:02:45 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2017-09-08 21:08:53 +0200
commit74d90e7cbc0f21136a40cd96b48ec41e38962cb2 (patch)
tree42d61a29a5903e59345877e273a9998fe5d6c45c /src/vars.c
parentd20f9a5d2e5b9903f7412cdec9e1bf28a94d02da (diff)
downloadcalcurse-74d90e7cbc0f21136a40cd96b48ec41e38962cb2.tar.gz
calcurse-74d90e7cbc0f21136a40cd96b48ec41e38962cb2.zip
Add CALCURSE_{EDITOR,PAGER,MERGETOOL} environment variables
Support environment variables specific to calcurse to override $EDITOR, $PAGER and $MERGETOOL. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/vars.c')
-rw-r--r--src/vars.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vars.c b/src/vars.c
index 1c0980c..c2ec106 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -130,19 +130,25 @@ void vars_init(void)
datefmt_str[3] = _("yyyy-mm-dd");
/* Default external editor and pager */
- ed = getenv("VISUAL");
+ ed = getenv("CALCURSE_EDITOR");
+ if (ed == NULL || ed[0] == '\0')
+ ed = getenv("VISUAL");
if (ed == NULL || ed[0] == '\0')
ed = getenv("EDITOR");
if (ed == NULL || ed[0] == '\0')
ed = DEFAULT_EDITOR;
conf.editor = ed;
- pg = getenv("PAGER");
+ pg = getenv("CALCURSE_PAGER");
+ if (pg == NULL || pg[0] == '\0')
+ pg = getenv("PAGER");
if (pg == NULL || pg[0] == '\0')
pg = DEFAULT_PAGER;
conf.pager = pg;
- mt = getenv("MERGETOOL");
+ mt = getenv("CALCURSE_MERGETOOL");
+ if (mt == NULL || mt[0] == '\0')
+ mt = getenv("MERGETOOL");
if (mt == NULL || mt[0] == '\0')
mt = DEFAULT_MERGETOOL;
conf.mergetool = mt;