Commit a439b764 authored by Peter Pentchev's avatar Peter Pentchev

HE_DEFAULT_PAGER as a fallback, overrideable.

Let the editor use the HE_DEFAULT_PAGER value from defs.h as
a last-resort fallback.

Reported by:	Jakub Wilk <jwilk@debian.org>
parent 20d1cbb7
......@@ -13,6 +13,11 @@ Change log for hexer, the multi-view binary editor
- fix a signed/unsigned char bug when reading the swapfile
- merge early when marking screen lines for refreshing
(reported by Jonathan Neuschäfer <j.neuschaefer@gmx.net>)
- let the editor use the HE_DEFAULT_PAGER value from defs.h as
a last-resort fallback (nothing in the environment, etc)
(reported by Jakub Wilk <jwilk@debian.org>)
- allow the default pager value to be overridden at build time
(reported by Jakub Wilk <jwilk@debian.org>)
0.1.8 2014/09/11
- fix a crash when inserting or replacing a half-byte
......
......@@ -38,7 +38,9 @@
/* hexer:
*/
#define HE_ANYCHAR '.'
#ifndef HE_DEFAULT_PAGER
#define HE_DEFAULT_PAGER "more"
#endif
#define HEXERINIT_FILE ".hexerrc"
#define TIO_READWAIT_TIMEOUT -1
......
......@@ -70,7 +70,6 @@
#include "util.h"
#define EXH_DEFAULT_SHELL "/bin/sh"
#define EXH_DEFAULT_PAGER "more"
#define EXIT_EXEC_FAILED 27
#ifndef ERESTARTSYS
......@@ -97,7 +96,7 @@ exh_shell_command(const char * const command, int pager_f)
* is `EXH_DEFAULT_SHELL'. */
/* if `pager != 0' the output is piped into the
* pager specified by the "PAGER" environment. the
* default pager is `EXH_DEFAULT_PAGER'. */
* default pager is `HE_DEFAULT_PAGER'. */
/* we won't use the "-c"-switch (available for most shells), instead we'll
* gonna pipe the command into the shell.
*/
......@@ -114,7 +113,7 @@ exh_shell_command(const char * const command, int pager_f)
tio_flush();
if (!(*shell = getenv("SHELL"))) *shell = strdup(EXH_DEFAULT_SHELL);
*shell = strdup(*shell);
if (!(*pager = getenv("PAGER"))) *pager = strdup(EXH_DEFAULT_PAGER);
if (!(*pager = getenv("PAGER"))) *pager = strdup(HE_DEFAULT_PAGER);
*pager = strdup(*pager);
/* break `*shell' and `*pager' down into whitespace separated
* substrings. it is *not* possible to mask whitespace characters in any
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment