1
1
mirror of https://github.com/walles/moar.git synced 2024-08-16 23:40:35 +03:00

Fix PAGER= setting detection

This commit is contained in:
Johan Walles 2019-07-15 22:47:36 +02:00
parent a77d4f058c
commit 8ad5329a8d

View File

@ -41,7 +41,11 @@ func _PrintUsage(output io.Writer) {
moarPath, err := filepath.Abs(os.Args[0])
if err == nil {
if os.Getenv("PAGER") != moarPath {
pagerValue, err := filepath.Abs(os.Getenv("PAGER"))
if err != nil {
pagerValue = ""
}
if pagerValue != moarPath {
// We're not the default pager
fmt.Fprintln(output)
fmt.Fprintln(output, "To make Moar your default pager, put the following line in")