summaryrefslogtreecommitdiff
path: root/src/report.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/report.h')
-rw-r--r--src/report.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/report.h b/src/report.h
index 8de38547..95d87e1e 100644
--- a/src/report.h
+++ b/src/report.h
@@ -811,16 +811,21 @@ public:
OPTION__
(report_t, pager_,
CTOR(report_t, pager_) {
- if (! std::getenv("PAGER") && isatty(STDOUT_FILENO)) {
- bool have_less = false;
- if (exists(path("/opt/local/bin/less")) ||
- exists(path("/usr/local/bin/less")) ||
- exists(path("/usr/bin/less")))
- have_less = true;
-
- if (have_less) {
- on(none, "less");
- setenv("LESS", "-FRSX", 0); // don't overwrite
+ if (isatty(STDOUT_FILENO)) {
+ if (! std::getenv("PAGER")) {
+ bool have_less = false;
+ if (exists(path("/opt/local/bin/less")) ||
+ exists(path("/usr/local/bin/less")) ||
+ exists(path("/usr/bin/less")))
+ have_less = true;
+
+ if (have_less) {
+ on(none, "less");
+ setenv("LESS", "-FRSX", 0); // don't overwrite
+ }
+ } else {
+ on(none, std::getenv("PAGER"));
+ setenv("LESS", "-FRSX", 0); // don't overwrite
}
}
});