- save section to history for first man page ()

- remove dot from summary Resolves: 
This commit is contained in:
Miroslav Lichvar 2007-02-23 14:20:08 +00:00
parent a393c1a624
commit c1abfca1bb
2 changed files with 49 additions and 4 deletions

View File

@ -0,0 +1,39 @@
--- pinfo-0.6.9/src/manual.c.mansection 2006-03-16 15:14:30.000000000 +0100
+++ pinfo-0.6.9/src/manual.c 2007-02-23 14:52:30.000000000 +0100
@@ -167,16 +167,29 @@
}
i = len;
/* find the beginning of the last token */
- for (i = len - 1;(i > 0) &&(!isspace(name1[i])); i--);
-
- /* if we've found space, then we move to the first nonspace character */
- if (i > 0)
- i++;
+ for (i = len - 1;(i >= 0) &&(!isspace(name1[i])); i--)
+ ;
+ i++;
/* filename->name */
- strcpy(manualhistory[0].name, &name1[i]);
+ snprintf(manualhistory[0].name, 256, "%s", &name1[i]);
+
/* section unknown */
- strcpy(manualhistory[0].sect, "");
+ manualhistory[0].sect[0] = 0;
+
+ /* try to find section */
+ if (i > 1) {
+ for (i--; (i >= 0) && isspace(name1[i]); i--)
+ ;
+ if (i >= 0) {
+ name1[i + 1] = 0;
+ for (; (i >= 0) && !isspace(name1[i]); i--)
+ ;
+ i++;
+ snprintf(manualhistory[0].sect, 32, "%s", &name1[i]);
+ }
+ }
+
/* selected unknown */
manualhistory[0].selected = -1;
/* pos=0 */

View File

@ -1,7 +1,7 @@
Summary: An info file viewer.
Summary: An info file viewer
Name: pinfo
Version: 0.6.9
Release: 2%{?dist}
Release: 3%{?dist}
Group: System Environment/Base
License: GPL
URL: http://pinfo.alioth.debian.org
@ -9,6 +9,7 @@ Source: pinfo-%{version}.tar.bz2
Patch1: pinfo-0.6.8-htmlview.patch
Patch2: pinfo-0.6.9-infosuff.patch
Patch3: pinfo-0.6.9-nogroup.patch
Patch4: pinfo-0.6.9-mansection.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ncurses-devel
@ -26,13 +27,14 @@ using regular expressions, and is based on the ncurses library.
%patch1 -p1 -b .links
%patch2 -p1 -b .infosuff
%patch3 -p1 -b .nogroup
%patch4 -p1 -b .mansection
%build
%configure --without-readline
make
make %{?_smp_mflags}
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
ln -sf pinfo $RPM_BUILD_ROOT%{_bindir}/pman
@ -68,6 +70,10 @@ fi
rm -rf $RPM_BUILD_ROOT
%changelog
* Fri Feb 23 2007 Miroslav Lichvar <mlichvar@redhat.com> 0.6.9-3
- save section of first man page to history (#208738)
- remove dot from summary
* Fri Jan 19 2007 Miroslav Lichvar <mlichvar@redhat.com> 0.6.9-2
- use correct group when dropping group privileges (#221107)
- open also files without .info suffix