OBS User unknown 2008-11-28 14:35:17 +00:00 committed by Git OBS Bridge
parent d2963e9491
commit 176358f1f3
3 changed files with 46 additions and 10 deletions

View File

@ -1,6 +1,6 @@
--- src/man.c
+++ src/man.c 2008-06-06 13:59:22.886201526 +0000
@@ -3208,12 +3208,108 @@ static int locate_page (const char *manp
+++ src/man.c 2008-11-28 13:12:22.171541000 +0100
@@ -3223,12 +3223,131 @@ static int locate_page (const char *manp
return found;
}
@ -21,11 +21,13 @@
{
struct candidate *candp;
int found = 0;
+ int plain = 0;
+
+#if defined(PROMPT_IF_MULTIPLE_SECTIONS) && (PROMPT_IF_MULTIPLE_SECTIONS > 1)
+ char reqsect[64] = { 0 };
+ ssize_t len;
+ ssize_t len = 0;
+ do {
+ const char *lext;
+ struct sigaction sa;
+ int used = 0x2A;
+
@ -50,12 +52,19 @@
+ fputs(_("find all matching manual pages"), stderr);
+ fputc('\n', stderr);
+
+ lext = NULL;
+ for (candp = candidates; candp; candp = candp->next) {
+ struct mandata *info = candp->source;
+ fprintf(stderr, " %c %s (%s)", used, info->name, info->ext);
+ const struct mandata *info = candp->source;
+ const char *base = "";
+
+ if (lext && STREQ(lext, info->ext))
+ base = "+";
+
+ fprintf(stderr, " %c %s (%s%s)", used, info->name, info->ext, base);
+ if (info->whatis)
+ fprintf(stderr, "\t%s", info->whatis);
+ fputc('\n', stderr);
+ lext = info->ext;
+ used = ' ';
+ }
+ fputs("Man: ", stderr);
@ -84,11 +93,21 @@
+ char * end;
+ if ((end = strchr(reqsect, '\n')))
+ *end = '\0';
+ if ((end = strchr(reqsect, '+'))) {
+ plain = 1;
+ *end = '\0';
+ }
+ reqsect[len] = '\0';
+ len = (ssize_t)strlen(reqsect);
+
+ for (candp = candidates; candp; candp = candp->next) {
+ if (len == 0)
+ break;
+ if (plain) {
+ const char *base = strrchr(candp->path, '/');
+ if (base && !STREQ(base, "/man"))
+ continue;
+ }
+ if ((found = STREQ(reqsect, candp->source->ext)))
+ break;
+ }
@ -98,18 +117,22 @@
+ }
+ } while (0);
+#endif
+
for (candp = candidates; candp; candp = candp->next) {
+
+#if defined(PROMPT_IF_MULTIPLE_SECTIONS) && (PROMPT_IF_MULTIPLE_SECTIONS > 1)
+ if (plain) {
+ const char *base = strrchr(candp->path, '/');
+ if (base && !STREQ(base, "/man"))
+ continue;
+ }
+ if (len && !STREQ(reqsect, candp->source->ext))
+ continue;
+#endif
+
global_manpath = is_global_mandir (candp->path);
if (!global_manpath)
drop_effective_privs ();
@@ -3235,9 +3331,51 @@ static int display_pages (struct candida
@@ -3250,9 +3369,51 @@ static int display_pages (struct candida
regain_effective_privs ();
if (found && !findall)

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Nov 28 13:15:30 CET 2008 - werner@suse.de
- For listall patch: add support for multiple man pages in the
same section (bnc#448283)
- Fix bug in listall patch: initialize variable len as this may
break on some system otherwise.
-------------------------------------------------------------------
Thu Nov 20 18:13:38 CET 2008 - werner@suse.de

View File

@ -31,7 +31,7 @@ BuildRequires: gettext-runtime gettext-tools
BuildRequires: gettext gettext-devel
%endif
Version: 2.5.2
Release: 16
Release: 17
Summary: A Program for Displaying man Pages
License: GPL v2 or later
Url: https://savannah.nongnu.org/projects/man-db
@ -285,6 +285,11 @@ test -d var/catman/ && rm -rf var/catman/ || true
%{_localstatedir}/adm/fillup-templates/sysconfig.cron-man
%changelog
* Fri Nov 28 2008 werner@suse.de
- For listall patch: add support for multiple man pages in the
same section (bnc#448283)
- Fix bug in listall patch: initialize variable len as this may
break on some system otherwise.
* Thu Nov 20 2008 werner@suse.de
- Skip mandocdb workaround as groff now works in UTF-8 (bnc#446710)
- Replace pipe(2) with socketpair(2) to speed up mandb (bnc#381830)