This commit is contained in:
parent
d2963e9491
commit
176358f1f3
@ -1,6 +1,6 @@
|
|||||||
--- src/man.c
|
--- src/man.c
|
||||||
+++ src/man.c 2008-06-06 13:59:22.886201526 +0000
|
+++ src/man.c 2008-11-28 13:12:22.171541000 +0100
|
||||||
@@ -3208,12 +3208,108 @@ static int locate_page (const char *manp
|
@@ -3223,12 +3223,131 @@ static int locate_page (const char *manp
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,11 +21,13 @@
|
|||||||
{
|
{
|
||||||
struct candidate *candp;
|
struct candidate *candp;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
+ int plain = 0;
|
||||||
|
+
|
||||||
+#if defined(PROMPT_IF_MULTIPLE_SECTIONS) && (PROMPT_IF_MULTIPLE_SECTIONS > 1)
|
+#if defined(PROMPT_IF_MULTIPLE_SECTIONS) && (PROMPT_IF_MULTIPLE_SECTIONS > 1)
|
||||||
+ char reqsect[64] = { 0 };
|
+ char reqsect[64] = { 0 };
|
||||||
+ ssize_t len;
|
+ ssize_t len = 0;
|
||||||
+ do {
|
+ do {
|
||||||
|
+ const char *lext;
|
||||||
+ struct sigaction sa;
|
+ struct sigaction sa;
|
||||||
+ int used = 0x2A;
|
+ int used = 0x2A;
|
||||||
+
|
+
|
||||||
@ -50,12 +52,19 @@
|
|||||||
+ fputs(_("find all matching manual pages"), stderr);
|
+ fputs(_("find all matching manual pages"), stderr);
|
||||||
+ fputc('\n', stderr);
|
+ fputc('\n', stderr);
|
||||||
+
|
+
|
||||||
|
+ lext = NULL;
|
||||||
+ for (candp = candidates; candp; candp = candp->next) {
|
+ for (candp = candidates; candp; candp = candp->next) {
|
||||||
+ struct mandata *info = candp->source;
|
+ const struct mandata *info = candp->source;
|
||||||
+ fprintf(stderr, " %c %s (%s)", used, info->name, info->ext);
|
+ 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)
|
+ if (info->whatis)
|
||||||
+ fprintf(stderr, "\t%s", info->whatis);
|
+ fprintf(stderr, "\t%s", info->whatis);
|
||||||
+ fputc('\n', stderr);
|
+ fputc('\n', stderr);
|
||||||
|
+ lext = info->ext;
|
||||||
+ used = ' ';
|
+ used = ' ';
|
||||||
+ }
|
+ }
|
||||||
+ fputs("Man: ", stderr);
|
+ fputs("Man: ", stderr);
|
||||||
@ -84,11 +93,21 @@
|
|||||||
+ char * end;
|
+ char * end;
|
||||||
+ if ((end = strchr(reqsect, '\n')))
|
+ if ((end = strchr(reqsect, '\n')))
|
||||||
+ *end = '\0';
|
+ *end = '\0';
|
||||||
|
+ if ((end = strchr(reqsect, '+'))) {
|
||||||
|
+ plain = 1;
|
||||||
|
+ *end = '\0';
|
||||||
|
+ }
|
||||||
+ reqsect[len] = '\0';
|
+ reqsect[len] = '\0';
|
||||||
+ len = (ssize_t)strlen(reqsect);
|
+ len = (ssize_t)strlen(reqsect);
|
||||||
|
+
|
||||||
+ for (candp = candidates; candp; candp = candp->next) {
|
+ for (candp = candidates; candp; candp = candp->next) {
|
||||||
+ if (len == 0)
|
+ if (len == 0)
|
||||||
+ break;
|
+ break;
|
||||||
|
+ if (plain) {
|
||||||
|
+ const char *base = strrchr(candp->path, '/');
|
||||||
|
+ if (base && !STREQ(base, "/man"))
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
+ if ((found = STREQ(reqsect, candp->source->ext)))
|
+ if ((found = STREQ(reqsect, candp->source->ext)))
|
||||||
+ break;
|
+ break;
|
||||||
+ }
|
+ }
|
||||||
@ -98,18 +117,22 @@
|
|||||||
+ }
|
+ }
|
||||||
+ } while (0);
|
+ } while (0);
|
||||||
+#endif
|
+#endif
|
||||||
+
|
|
||||||
for (candp = candidates; candp; candp = candp->next) {
|
for (candp = candidates; candp; candp = candp->next) {
|
||||||
+
|
+
|
||||||
+#if defined(PROMPT_IF_MULTIPLE_SECTIONS) && (PROMPT_IF_MULTIPLE_SECTIONS > 1)
|
+#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))
|
+ if (len && !STREQ(reqsect, candp->source->ext))
|
||||||
+ continue;
|
+ continue;
|
||||||
+#endif
|
+#endif
|
||||||
+
|
|
||||||
global_manpath = is_global_mandir (candp->path);
|
global_manpath = is_global_mandir (candp->path);
|
||||||
if (!global_manpath)
|
if (!global_manpath)
|
||||||
drop_effective_privs ();
|
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 ();
|
regain_effective_privs ();
|
||||||
|
|
||||||
if (found && !findall)
|
if (found && !findall)
|
||||||
|
@ -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
|
Thu Nov 20 18:13:38 CET 2008 - werner@suse.de
|
||||||
|
|
||||||
|
7
man.spec
7
man.spec
@ -31,7 +31,7 @@ BuildRequires: gettext-runtime gettext-tools
|
|||||||
BuildRequires: gettext gettext-devel
|
BuildRequires: gettext gettext-devel
|
||||||
%endif
|
%endif
|
||||||
Version: 2.5.2
|
Version: 2.5.2
|
||||||
Release: 16
|
Release: 17
|
||||||
Summary: A Program for Displaying man Pages
|
Summary: A Program for Displaying man Pages
|
||||||
License: GPL v2 or later
|
License: GPL v2 or later
|
||||||
Url: https://savannah.nongnu.org/projects/man-db
|
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
|
%{_localstatedir}/adm/fillup-templates/sysconfig.cron-man
|
||||||
|
|
||||||
%changelog
|
%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
|
* Thu Nov 20 2008 werner@suse.de
|
||||||
- Skip mandocdb workaround as groff now works in UTF-8 (bnc#446710)
|
- Skip mandocdb workaround as groff now works in UTF-8 (bnc#446710)
|
||||||
- Replace pipe(2) with socketpair(2) to speed up mandb (bnc#381830)
|
- Replace pipe(2) with socketpair(2) to speed up mandb (bnc#381830)
|
||||||
|
Loading…
Reference in New Issue
Block a user