rpms/less/F-8 less-406-Foption.patch,1.1,1.2 less.spec,1.43,1.44
Zdenek Prikryl (zprikryl)
fedora-extras-commits at redhat.com
Fri Jan 18 13:33:09 UTC 2008
Author: zprikryl
Update of /cvs/extras/rpms/less/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25284
Modified Files:
less-406-Foption.patch less.spec
Log Message:
Fixed -F option
Resolves: #427551
less-406-Foption.patch:
Index: less-406-Foption.patch
===================================================================
RCS file: /cvs/extras/rpms/less/F-8/less-406-Foption.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- less-406-Foption.patch 26 Jun 2007 10:09:21 -0000 1.1
+++ less-406-Foption.patch 18 Jan 2008 13:32:54 -0000 1.2
@@ -1,6 +1,41 @@
---- less-406/screen.c.pom 2007-06-17 18:56:04.000000000 +0200
-+++ less-406/screen.c 2007-06-26 11:10:56.000000000 +0200
-@@ -233,6 +233,7 @@ extern int wscroll;
+--- less-406/main.c.Foption 2007-06-17 18:56:04.000000000 +0200
++++ less-406/main.c 2008-01-11 10:18:46.000000000 +0100
+@@ -33,6 +33,7 @@ public int quitting;
+ public int secure;
+ public int dohelp;
+ public int less_is_more;
++public int line_count;
+
+ #if LOGFILE
+ public int logfile = -1;
+@@ -280,6 +281,16 @@ main(argc, argv)
+ {
+ if (edit_first()) /* Edit first valid file in cmd line */
+ quit(QUIT_ERROR);
++ /*
++ * In case that we have only one file and -F, have to get a line
++ * count fot init(). If the line count is less then a height of a term,
++ * the content of the file is printed out and then less quits. Otherwise
++ * -F can not be used
++ */
++ if (nifile() == 1 && quit_if_one_screen)
++ line_count = get_line_count();
++ else if (nifile() > 1) /* In case more than one file, -F can not be used */
++ quit_if_one_screen = FALSE;
+ }
+
+ init();
+--- less-406/screen.c.Foption 2007-06-17 18:56:04.000000000 +0200
++++ less-406/screen.c 2008-01-11 10:20:00.000000000 +0100
+@@ -204,6 +204,7 @@ public int missing_cap = 0; /* Some capa
+
+ static int attrmode = AT_NORMAL;
+ extern int binattr;
++extern int line_count;
+
+ #if !MSDOS_COMPILER
+ static char *cheaper();
+@@ -233,6 +234,7 @@ extern int wscroll;
extern int screen_trashed;
extern int tty;
extern int top_scroll;
@@ -8,12 +43,63 @@
extern int oldbot;
#if HILITE_SEARCH
extern int hilite_search;
-@@ -1573,7 +1574,7 @@ deinit()
+@@ -1534,7 +1536,9 @@ win32_deinit_term()
+ init()
+ {
+ #if !MSDOS_COMPILER
+- if (!no_init)
++ if (quit_if_one_screen && line_count >= sc_height)
++ quit_if_one_screen = FALSE;
++ if (!no_init && !quit_if_one_screen)
+ tputs(sc_init, sc_height, putchr);
+ if (!no_keypad)
+ tputs(sc_s_keypad, sc_height, putchr);
+@@ -1573,8 +1577,9 @@ deinit()
#if !MSDOS_COMPILER
if (!no_keypad)
tputs(sc_e_keypad, sc_height, putchr);
- if (!no_init)
-+ if (!no_init && !quit_if_one_screen)
- tputs(sc_deinit, sc_height, putchr);
+- tputs(sc_deinit, sc_height, putchr);
++ if (!no_init && !quit_if_one_screen)
++ tputs(sc_deinit, sc_height, putchr);
++
#else
/* Restore system colors. */
+ SETCOLORS(sy_fg_color, sy_bg_color);
+--- less-406/funcs.h.Foption 2007-03-24 07:27:54.000000000 +0100
++++ less-406/funcs.h 2008-01-11 09:36:16.000000000 +0100
+@@ -126,6 +126,7 @@
+ public void forward ();
+ public void backward ();
+ public int get_back_scroll ();
++ public int get_line_count ();
+ public void del_ifile ();
+ public IFILE next_ifile ();
+ public IFILE prev_ifile ();
+--- less-406/forwback.c.Foption 2007-06-17 18:56:04.000000000 +0200
++++ less-406/forwback.c 2008-01-11 09:37:15.000000000 +0100
+@@ -410,3 +410,24 @@ get_back_scroll()
+ return (sc_height - 2);
+ return (10000); /* infinity */
+ }
++
++/*
++ * Get line count of file
++ */
++ public int
++get_line_count()
++{
++ int nlines = 0;
++ POSITION pos;
++
++ pos = position(TOP);
++
++ while (pos != NULL_POSITION)
++ {
++ pos = forw_line(pos);
++ nlines++;
++ }
++
++ return nlines;
++}
++
Index: less.spec
===================================================================
RCS file: /cvs/extras/rpms/less/F-8/less.spec,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- less.spec 19 Dec 2007 09:37:36 -0000 1.43
+++ less.spec 18 Jan 2008 13:32:54 -0000 1.44
@@ -1,7 +1,7 @@
Summary: A text file browser similar to more, but better
Name: less
Version: 406
-Release: 13%{?dist}
+Release: 14%{?dist}
License: BSD
Group: Applications/Text
Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz
@@ -65,6 +65,10 @@
rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Jan 18 2008 Zdenek Prikryl <iprikryl at redhat.com> - 406-14
+- Fixed -F option
+- Resolves: #427551
+
* Wed Dec 19 2007 Zdenek Prikryl <iprikryl at redhat.com> - 406-13
- Fixed sigsegv when displaying non-existing file after short file
- Resolves: #426107
More information about the fedora-extras-commits
mailing list