summaryrefslogtreecommitdiff
path: root/src/vars.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-09-29 14:14:19 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2011-10-04 11:05:43 +0200
commitc41eda256d7a963ee651b2532e9e18f76581fcfb (patch)
tree2c358a352b4f2c6a70f991a42e77560909917f8b /src/vars.c
parent9f1fed3ed1f77620334302616a6ed881ca78878d (diff)
downloadcalcurse-c41eda256d7a963ee651b2532e9e18f76581fcfb.zip
Do not hardcode paths to the default editor/pager
Use "vi" instead of "/usr/bin/vi" and "less" instead of "/usr/bin/less". Hardcoding absolute paths is a bad idea: $ uname -rsv Linux 3.0-ARCH #1 SMP PREEMPT Tue Aug 30 07:32:23 UTC 2011 $ which less /bin/less The "$PATH" environment variable will almost always have a better idea of where these binaries are located. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/vars.c')
-rw-r--r--src/vars.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vars.c b/src/vars.c
index 4b1d7cd..84f8b08 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -114,8 +114,6 @@ struct dmon_conf dmon;
void
vars_init (struct conf *conf)
{
- char *PATH_VI = "/usr/bin/vi";
- char *PATH_LESS = "/usr/bin/less";
char *ed, *pg;
/* Variables for user configuration */
@@ -133,12 +131,12 @@ vars_init (struct conf *conf)
if (ed == NULL || ed[0] == '\0')
ed = getenv ("EDITOR");
if (ed == NULL || ed[0] == '\0')
- ed = PATH_VI;
+ ed = DEFAULT_EDITOR;
conf->editor = ed;
pg = getenv ("PAGER");
if (pg == NULL || pg[0] == '\0')
- pg = PATH_LESS;
+ pg = DEFAULT_PAGER;
conf->pager = pg;
wins_set_layout (1);