Option -E is different for "less" and "more".

for "less" - causes to automatically exit the first time it reaches
end-of-file.

for "more" - option -E and -e is equivalent and causes to automatically
exit the second time it reaches end-of-file.

Behaviour "exit the first time it reaches end-of-file" set on default for
"more", therefore was removed scan_option("-E").

This patch return the old behaviour:
Index: command.c
===================================================================
RCS file: /cvs/src/usr.bin/less/command.c,v
retrieving revision 1.10
diff -u -p -r1.10 command.c
--- command.c   21 Sep 2011 19:01:49 -0000      1.10
+++ command.c   6 Oct 2011 16:58:18 -0000
@@ -55,6 +55,8 @@ extern int shift_count;
 extern int oldbot;
 extern int forw_prompt;
 extern int be_helpful;
+extern int less_is_more;
+extern int quit_at_eof;
 
 #if SHELL_ESCAPE
 static char *shellcmd = NULL;  /* For holding last shell command for "!!" */
@@ -1232,6 +1234,8 @@ commands()
                         */
                        if (sigs && !ABORT_SIGS())
                                newaction = A_F_FOREVER;
+                       if (less_is_more)
+                               quit_at_eof = OPT_ON;
                        break;
 
                case A_F_SCROLL:


On Thu, Oct 06, 2011 at 03:26:10PM +0100, Nicholas Marriott wrote:
> Yep they seem to have actually changed the behaviour of -E, I've been
> looking to see if we can restore the old behaviour but haven't got it
> yet.
> 
> 
> 
> On Thu, Oct 06, 2011 at 02:46:27PM +0100, Stuart Henderson wrote:
> > Oh hmm I was slightly mistaken; G did actually exit more before,
> > so only the behaviour of F ^C has changed.
> > 
> > Thanks for pointing out -E, that changes behaviour of both G and
> > F^C (which I can quite imagine some people won't want) but I am happy
> > to set that in MORE for myself.
> > 
> > 
> > 
> > On 2011/10/06 13:51, Nicholas Marriott wrote:
> > > Does this restore the old behaviour?
> > > 
> > > I don't remember why -E was left out... Alexandr?
> > > 
> > > 
> > > Index: main.c
> > > ===================================================================
> > > RCS file: /cvs/src/usr.bin/less/main.c,v
> > > retrieving revision 1.11
> > > diff -u -p -r1.11 main.c
> > > --- main.c        16 Sep 2011 18:12:09 -0000      1.11
> > > +++ main.c        6 Oct 2011 12:50:24 -0000
> > > @@ -135,6 +135,7 @@ main(argc, argv)
> > >   init_prompt();
> > >  
> > >   if (less_is_more) {
> > > +         scan_option("-E");
> > >           scan_option("-G");
> > >           scan_option("-L");
> > >           scan_option("-X");
> > > 
> > > 
> > > On Thu, Oct 06, 2011 at 11:07:30AM +0100, Stuart Henderson wrote:
> > > > With the old version of less, when called as either "more" or "less",
> > > > if you press either G or F ^C, you would be left at a prompt at the end
> > > > of the file.
> > > > 
> > > > In the updated version these differ; called as "less" this works fine,
> > > > but as "more" it exits.
> > > > 
> > > > Not sure if this is intentional but I'm finding it quite annoying as
> > > > I find it a lot easier to type "more" than "less"..
> > > 

-- 
Alexandr Shadchin

Reply via email to