Path: utzoo!attcan!uunet!wyse!vsi1!ames!ncar!tank!uxc!uxc.cso.uiuc.edu!kailand!pwolfe From: pwolfe@kailand.KAI.COM Newsgroups: comp.sources.bugs Subject: reimplemented feature in less Message-ID: <2800001@kailand> Date: 22 Sep 88 12:51:00 GMT Lines: 56 Nf-ID: #N:kailand:2800001:000:1347 Nf-From: kailand.KAI.COM!pwolfe Sep 22 07:51:00 1988 Version 73 of less (-: Why the new version number scheme, Mark? Trying to confuse us? :-) had a feature that was eliminated in the recent posting. The "e" option still quits the second time you reach end of file, but now if a single file being displayed that is less than one screen length, less doesn't exit immediately, but displays it's prompt instead. I prefered the old action. The following patch adds four lines to prim.c to re-implement this feature. Feed to patch or hand implement if you like. Patrick J. Wolfe (pwolfe@kai.com, uunet!kailand!pwolfe) System Manager, Kuck and Associates Inc. *** oldprim.c Thu Sep 22 07:30:29 1988 --- prim.c Thu Sep 22 07:29:48 1988 *************** *** 21,26 extern int linenums; extern int plusoption; extern char *line; extern char *first_cmd; #if TAGS extern int tagoption; --- 21,27 ----- extern int linenums; extern int plusoption; extern char *line; + extern int ac; extern char *first_cmd; #if TAGS extern int tagoption; *************** *** 198,203 eof_bell(); else if (do_repaint) repaint(); first_time = 0; (void) currline(BOTTOM); } --- 199,207 ----- eof_bell(); else if (do_repaint) repaint(); + if (first_time && hit_eof && quit_at_eof && ac <= 1) { + quit (); + } first_time = 0; (void) currline(BOTTOM); }