Recent change in less(1)

Ted Lindgreen ted at tednet.nl
Tue Aug 7 03:48:26 PDT 2007


Hi,

The recent change in the behaviour of less(1)

<ted at alpha:2> rcsdiff -u -r1.9 -r1.10 /home/ncvs/src/contrib/less/main.c,v 
===================================================================
RCS file: /home/ncvs/src/contrib/less/main.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- main.c      2007/06/23 15:28:00     1.9
+++ main.c      2007/08/04 13:16:09     1.10
@@ -165,7 +165,7 @@
                quit(QUIT_OK);
        }
 
-       if (less_is_more && get_quit_at_eof())
+       if (less_is_more || get_quit_at_eof())
                no_init = quit_if_one_screen = TRUE;
 
wonders me a little.

Is this really the desired behaviour?

If so I have a question: how to obtain the former behaviour of the -e
switch, i.e. quit when EOF is hit twice always (thus whether or not
when the file happens to fit on a single page)?

I also have a remark: I think that also the man-page should be updated,
because:

  COMPATIBILITY WITH MORE
       .....
       The -e option works differently.  If the -e option  is  not  set,  less
       behaves	as  if	the -E option were set.  If the -e option is set, less
       behaves as if the -e and -F options were set.

is no longer the case.
With above change, more-compatibility OR -e implies -F, while above
documents that only more-compatibility AND -e would imply -F.

regards,
-- ted


More information about the freebsd-current mailing list