[Bug 10816] New: less: -R is rejected as CLI argument (but works at the env var LESS)

bugzilla at busybox.net bugzilla at busybox.net
Tue Feb 27 09:38:52 UTC 2018


https://bugs.busybox.net/show_bug.cgi?id=10816

            Bug ID: 10816
           Summary: less: -R is rejected as CLI argument (but works at the
                    env var LESS)
           Product: Busybox
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: avihpit at yahoo.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Using busybox git current master (2328690) on Ubuntu 16.04, with
CONFIG_FEATURE_LESS_RAW enabled, running:
  ./busybox less -R path/to/file
Rejects the -R arg and prints the help.

Setting the env var LESS=-R does work as expected and filters out raw escapes.

It appears that getopt setup is missing "R" .

This patch fixes the issue for me:

diff --git a/miscutils/less.c b/miscutils/less.c
index 97ab1e6..bfdf507 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -1814,7 +1814,7 @@ int less_main(int argc, char **argv)
         * -s: condense many empty lines to one
         *     (used by some setups for manpage display)
         */
-       getopt32(argv, "EMmN~I" IF_FEATURE_LESS_TRUNCATE("S") /*ignored:*/"s");
+       getopt32(argv, "EMmN~I" IF_FEATURE_LESS_TRUNCATE("S") /*ignored:*/"s"
IF_FEATURE_LESS_RAW("R"));
        argv += optind;
        num_files = argc - optind;
        files = argv;

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list