From 6e32c032d07598e89cc2a71b1c028d37ff297930adccada0a7981cb35659d005 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 17 Aug 2007 16:56:07 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/less?expand=0&rev=4 --- less-406-save_line_position.patch | 69 +++++++++++++++++++++++++++++++ less.changes | 6 +++ less.spec | 7 +++- 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 less-406-save_line_position.patch diff --git a/less-406-save_line_position.patch b/less-406-save_line_position.patch new file mode 100644 index 0000000..b5df9e5 --- /dev/null +++ b/less-406-save_line_position.patch @@ -0,0 +1,69 @@ +--- line.c ++++ line.c +@@ -68,6 +68,25 @@ + static int mbc_buf_index = 0; + static POSITION mbc_pos; + ++ ++ ++/* Following define alters the "-r" switch to not throw ++ * away location information, but keep location as well ++ * as "possible" (currently only interpreting location escape ++ * sequences ++ * ++ * This benefits the user who may be operating with "-r" but ++ * is still displaying predominantly "normal" spacing characters ++ * (especially single, 8-bit characters that print "normally" ++ * but might otherwise be "undisplayable" in non "-r" mode. ++ * ++ * This is especially true using extended European characters ++ * that might be present in UTF-8 docs (among others); ++ * - lawless@tlinx.org ++ */ ++#define THROW_AWAY_LOCATION 0 ++ ++ + /* + * Initialize from environment variables. + */ +@@ -620,7 +639,11 @@ + w = pwidth(ch, a, prev_ch); + } + +- if (ctldisp != OPT_ON && column + w + attr_ewidth(a) > sc_width) ++ if ( ++#if THROW_AWAY_LOCATION ++ ctldisp != OPT_ON && ++#endif ++ column + w + attr_ewidth(a) > sc_width) + /* + * Won't fit on screen. + */ +@@ -952,7 +975,11 @@ + { + STORE_PRCHAR((char) ch, pos); + } +- } else if (utf_mode && ctldisp != OPT_ON && is_ubin_char(ch)) ++ } else if (utf_mode && ++#if THROW_AWAY_LOCATION ++ ctldisp != OPT_ON && ++#endif ++ is_ubin_char(ch)) + { + char *s; + +@@ -1038,9 +1065,12 @@ + * that blank line would be ignored!) + */ + if (!oldbot) +- nl = (column < sc_width || !auto_wrap || (endline && ignaw) || ctldisp == OPT_ON); ++ nl = (column < sc_width || !auto_wrap || (endline && ignaw)); + else +- nl = (column < sc_width || !auto_wrap || ignaw || ctldisp == OPT_ON); ++ nl = (column < sc_width || !auto_wrap || ignaw); ++#if THROW_AWAY_LOCATION ++ nl = nl || ctldisp == OPT_ON; ++#endif + if (nl) + { + linebuf[curr] = '\n'; diff --git a/less.changes b/less.changes index 34b2fea..5781d4e 100644 --- a/less.changes +++ b/less.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Aug 17 10:23:08 CEST 2007 - anosek@suse.cz + +- fixed Incorrect behaviour of -r parameter [#244791] + (save_line_position.patch) + ------------------------------------------------------------------- Fri Jul 27 10:25:23 CEST 2007 - anosek@suse.cz diff --git a/less.spec b/less.spec index ca080b2..eb17e7a 100644 --- a/less.spec +++ b/less.spec @@ -21,7 +21,7 @@ Provides: normal-less jless Requires: file Autoreqprov: on Version: 406 -Release: 1 +Release: 7 Summary: Text File Browser and Pager Similar to more URL: http://www.greenwoodsoftware.com/less/ Source: %{name}-%{version}.tar.bz2 @@ -36,6 +36,7 @@ Patch23: %{name}-%{version}-mouse.patch Patch24: %{name}-%{version}-terminate.patch Patch25: %{name}-%{version}-widechars.patch Patch26: %{name}-%{version}-shell.patch +Patch27: %{name}-%{version}-save_line_position.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -59,6 +60,7 @@ Authors: %patch24 %patch25 %patch26 +%patch27 # # the ./configure script is not writable for the normal user # rather fix permissions for all files @@ -104,6 +106,9 @@ rm -rf $RPM_BUILD_ROOT %{prefix}/bin/* %changelog +* Fri Aug 17 2007 - anosek@suse.cz +- fixed Incorrect behaviour of -r parameter [#244791] + (save_line_position.patch) * Fri Jul 27 2007 - anosek@suse.cz - updated to version 406 * Allow decimal point in number for %% (percent) command.