Update to 471

This commit is contained in:
Jozef Mlich 2014-12-17 17:43:11 +01:00
parent e581d3f3f5
commit 4dff135eed
5 changed files with 57 additions and 63 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/less-444.tar.gz
/less-451.tar.gz
/less-458.tar.gz
/less-471.tar.gz

View File

@ -7,46 +7,40 @@ Original patch written by Jindrich Novy <jnovy@redhat.com>.
Changes and improvements by Zdenek Prikryl <zprikryl@redhat.com>,
Vojtech Vitek <vvitek@redhat.com> and Colin Guthrie <colin@mageia.org>.
Jozef Mlich <jmlich@redhat.com>
---
forwback.c | 20 ++++++++++++++++++++
funcs.h | 1 +
main.c | 16 ++++++++++++++++
screen.c | 9 +++++++--
4 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/forwback.c b/forwback.c
index ebe422d..687355f 100644
--- a/forwback.c
+++ b/forwback.c
@@ -422,3 +422,23 @@ get_back_scroll()
diff -up ./less-466/forwback.c.Foption ./less-466/forwback.c
--- ./less-466/forwback.c.Foption 2014-08-24 02:46:52.000000000 +0200
+++ ./less-466/forwback.c 2014-09-18 13:54:28.804626580 +0200
@@ -440,3 +440,24 @@ get_back_scroll()
return (sc_height - 2);
return (10000); /* infinity */
}
+
+
+/*
+ * Get line count of file up to the screen height + 1 char
+ */
+ public int
+get_line_count()
+{
+ int nlines = 0;
+ POSITION pos;
+ int nlines = 0;
+ POSITION pos;
+
+ pos = ch_zero();
+ pos = ch_zero();
+
+ while (pos != NULL_POSITION && nlines <= sc_height)
+ {
+ pos = forw_line(pos);
+ nlines++;
+ }
+ while (pos != NULL_POSITION && nlines <= sc_height)
+ {
+ pos = forw_line(pos);
+ nlines++;
+ }
+
+ return nlines;
+ return nlines;
+}
diff --git a/funcs.h b/funcs.h
index 6595232..8ca4656 100644
--- a/funcs.h
+++ b/funcs.h
@@ -136,6 +136,7 @@
diff -up ./less-466/funcs.h.Foption ./less-466/funcs.h
--- ./less-466/funcs.h.Foption 2014-08-24 02:46:54.000000000 +0200
+++ ./less-466/funcs.h 2014-09-18 13:55:12.140010010 +0200
@@ -139,6 +139,7 @@
public void forward ();
public void backward ();
public int get_back_scroll ();
@ -54,34 +48,37 @@ index 6595232..8ca4656 100644
public void del_ifile ();
public IFILE next_ifile ();
public IFILE prev_ifile ();
diff --git a/main.c b/main.c
index 0af1762..ef69440 100644
--- a/main.c
+++ b/main.c
@@ -55,6 +55,7 @@ static char consoleTitle[256];
diff -up ./less-466/main.c.Foption ./less-466/main.c
--- ./less-466/main.c.Foption 2014-08-24 02:46:51.000000000 +0200
+++ ./less-466/main.c 2014-09-18 14:03:12.868331522 +0200
@@ -54,8 +54,10 @@ static char consoleTitle[256];
#endif
extern int less_is_more;
+public int line_count;
+public int line_count;
extern int missing_cap;
extern int know_dumb;
extern int quit_if_one_screen;
@@ -277,10 +278,25 @@ main(argc, argv)
+extern int quit_if_one_screen;
extern int pr_type;
@@ -273,10 +275,27 @@ main(argc, argv)
{
if (edit_stdin()) /* Edit standard input */
quit(QUIT_ERROR);
+ if (quit_if_one_screen)
+ line_count = get_line_count();
+
} else
{
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
+ */
+ /*
+ * 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 (quit_if_one_screen)
+ {
+ if (nifile() == 1)
@ -89,14 +86,14 @@ index 0af1762..ef69440 100644
+ else /* In case more than one file, -F can not be used */
+ quit_if_one_screen = FALSE;
+ }
+
}
init();
diff --git a/screen.c b/screen.c
index b8bc666..1883e3e 100644
--- a/screen.c
+++ b/screen.c
@@ -204,6 +204,7 @@ public int missing_cap = 0; /* Some capability is missing */
diff -up ./less-466/screen.c.Foption ./less-466/screen.c
--- ./less-466/screen.c.Foption 2014-08-24 02:46:51.000000000 +0200
+++ ./less-466/screen.c 2014-09-18 13:58:52.772962165 +0200
@@ -203,6 +203,7 @@ public int missing_cap = 0; /* Some capa
static int attrmode = AT_NORMAL;
extern int binattr;
@ -104,7 +101,7 @@ index b8bc666..1883e3e 100644
#if !MSDOS_COMPILER
static char *cheaper();
@@ -233,6 +234,7 @@ extern int wscroll;
@@ -232,6 +233,7 @@ extern int wscroll;
extern int screen_trashed;
extern int tty;
extern int top_scroll;
@ -112,7 +109,7 @@ index b8bc666..1883e3e 100644
extern int oldbot;
#if HILITE_SEARCH
extern int hilite_search;
@@ -1534,7 +1536,9 @@ win32_deinit_term()
@@ -1533,7 +1535,9 @@ win32_deinit_term()
init()
{
#if !MSDOS_COMPILER
@ -123,17 +120,12 @@ index b8bc666..1883e3e 100644
tputs(sc_init, sc_height, putchr);
if (!no_keypad)
tputs(sc_s_keypad, sc_height, putchr);
@@ -1574,8 +1578,9 @@ deinit()
@@ -1573,7 +1577,7 @@ 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);
+
#else
/* Restore system colors. */
SETCOLORS(sy_fg_color, sy_bg_color);
--
1.7.7.6

View File

@ -1,9 +1,9 @@
diff -upr less-458_orig/less.nro less-458_work/less.nro
--- less-458_orig/less.nro 2013-05-07 14:20:52.237332235 +0200
+++ less-458_work/less.nro 2013-05-07 14:22:23.142708098 +0200
@@ -1228,6 +1228,18 @@ Similarly, if the first two characters o
diff -up less-466/less.nro.filters-man less-466/less.nro
--- less-466/less.nro.filters-man 2014-09-18 14:32:32.124111631 +0200
+++ less-466/less.nro 2014-09-18 14:32:39.548177152 +0200
@@ -1234,6 +1234,18 @@ Similarly, if the first two characters o
the input pipe is used on standard input as well as other files.
Again, in this case the dash is not considered to be part of
Again, in this case the dash is not considered to be part of
the input pipe command.
+.PP
+There are used following files to set up default preprocessor:

View File

@ -1,7 +1,7 @@
Summary: A text file browser similar to more, but better
Name: less
Version: 458
Release: 13%{?dist}
Version: 471
Release: 1%{?dist}
License: GPLv3+
Group: Applications/Text
Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz
@ -18,7 +18,6 @@ Patch8: less-458-lessecho-usage.patch
Patch9: less-458-less-filters-man.patch
Patch10: less-458-lesskey-usage.patch
Patch11: less-458-old-bot-in-help.patch
Patch12: less-458-outdated-unicode-data.patch
URL: http://www.greenwoodsoftware.com/less/
Requires: groff-base
BuildRequires: ncurses-devel
@ -36,7 +35,7 @@ files, and you'll use it frequently.
%prep
%setup -q
%patch1 -p1 -b .Foption
%patch1 -p2 -b .Foption
%patch2 -p1 -b .search
%patch4 -p1 -b .time
%patch5 -p1 -b .fsync
@ -46,7 +45,6 @@ files, and you'll use it frequently.
%patch9 -p1 -b .less-filters-man
%patch10 -p1 -b .lesskey-usage
%patch11 -p1 -b .old-bot
%patch12 -p1 -b .outdated-unicode-data
autoreconf
chmod -R a+w *
@ -77,6 +75,9 @@ ls -la $RPM_BUILD_ROOT/etc/profile.d
rm -rf $RPM_BUILD_ROOT
%changelog
* Wed Dec 17 2014 Jozef Mlich <jmlich@redhat.com> - 471-1
- Update to 471
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 458-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

View File

@ -1 +1 @@
935b38aa2e73c888c210dedf8fd94f49 less-458.tar.gz
9a40d29a2d84b41f9f36d7dd90b4f950 less-471.tar.gz