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>
This commit is contained in:
parent
9f1fed3ed1
commit
c41eda256d
@ -100,6 +100,9 @@
|
|||||||
#define DPID_PATH DIR_NAME DPID_PATH_NAME
|
#define DPID_PATH DIR_NAME DPID_PATH_NAME
|
||||||
#define NOTES_DIR DIR_NAME NOTES_DIR_NAME
|
#define NOTES_DIR DIR_NAME NOTES_DIR_NAME
|
||||||
|
|
||||||
|
#define DEFAULT_EDITOR "vi"
|
||||||
|
#define DEFAULT_PAGER "less"
|
||||||
|
|
||||||
#define ATTR_FALSE 0
|
#define ATTR_FALSE 0
|
||||||
#define ATTR_TRUE 1
|
#define ATTR_TRUE 1
|
||||||
#define ATTR_LOWEST 2
|
#define ATTR_LOWEST 2
|
||||||
|
@ -114,8 +114,6 @@ struct dmon_conf dmon;
|
|||||||
void
|
void
|
||||||
vars_init (struct conf *conf)
|
vars_init (struct conf *conf)
|
||||||
{
|
{
|
||||||
char *PATH_VI = "/usr/bin/vi";
|
|
||||||
char *PATH_LESS = "/usr/bin/less";
|
|
||||||
char *ed, *pg;
|
char *ed, *pg;
|
||||||
|
|
||||||
/* Variables for user configuration */
|
/* Variables for user configuration */
|
||||||
@ -133,12 +131,12 @@ vars_init (struct conf *conf)
|
|||||||
if (ed == NULL || ed[0] == '\0')
|
if (ed == NULL || ed[0] == '\0')
|
||||||
ed = getenv ("EDITOR");
|
ed = getenv ("EDITOR");
|
||||||
if (ed == NULL || ed[0] == '\0')
|
if (ed == NULL || ed[0] == '\0')
|
||||||
ed = PATH_VI;
|
ed = DEFAULT_EDITOR;
|
||||||
conf->editor = ed;
|
conf->editor = ed;
|
||||||
|
|
||||||
pg = getenv ("PAGER");
|
pg = getenv ("PAGER");
|
||||||
if (pg == NULL || pg[0] == '\0')
|
if (pg == NULL || pg[0] == '\0')
|
||||||
pg = PATH_LESS;
|
pg = DEFAULT_PAGER;
|
||||||
conf->pager = pg;
|
conf->pager = pg;
|
||||||
|
|
||||||
wins_set_layout (1);
|
wins_set_layout (1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user