Dr. Werner Fink 2012-10-29 12:56:42 +00:00 committed by Git OBS Bridge
parent 2e4a381342
commit 6c95d54abe
2 changed files with 29 additions and 10 deletions

View File

@ -1,6 +1,6 @@
--- src/man.c
+++ src/man.c 2008-11-28 12:12:22.000000000 +0000
@@ -3712,12 +3712,132 @@ static int locate_page (const char *manp
+++ src/man.c 2012-10-29 13:48:02.134344676 +0100
@@ -3712,12 +3712,141 @@ static int locate_page (const char *manp
return found;
}
@ -26,8 +26,9 @@
+#if defined(PROMPT_IF_MULTIPLE_SECTIONS) && (PROMPT_IF_MULTIPLE_SECTIONS > 1)
+ char reqsect[64] = { 0 };
+ ssize_t len = 0;
+ do {
+ int index = -1;
+ const char *lext;
+ do {
+ struct sigaction sa;
+ int used = 0x2A;
+
@ -56,12 +57,12 @@
+ lext = NULL;
+ for (candp = candidates; candp; candp = candp->next) {
+ const struct mandata *info = candp->source;
+ const char *base = "";
+
+ if (lext && STREQ(lext, info->ext))
+ base = "+";
+ fprintf(stderr, " %c %s (%s+%d)", used, info->name, info->ext, candp->add_index);
+ else
+ fprintf(stderr, " %c %s (%s)", used, info->name, info->ext);
+
+ fprintf(stderr, " %c %s (%s%s)", used, info->name, info->ext, base);
+ if (info->whatis)
+ fprintf(stderr, "\t%s", info->whatis);
+ fputc('\n', stderr);
@ -97,6 +98,8 @@
+ if ((end = strchr(reqsect, '+'))) {
+ plain = 1;
+ *end = '\0';
+ if (*++end)
+ index = atoi(end);
+ }
+ reqsect[len] = '\0';
+ len = (ssize_t)strlen(reqsect);
@ -109,6 +112,8 @@
+ if (base && !STREQ(base, "/man"))
+ continue;
+ }
+ if (index >= 0 && index != candp->add_index)
+ continue;
+ if ((found = STREQ(reqsect, candp->source->ext)))
+ break;
+ }
@ -127,13 +132,17 @@
+ if (base && !STREQ(base, "/man"))
+ continue;
+ }
+ if (len && !STREQ(reqsect, candp->source->ext))
+ if (len) {
+ if (!STREQ(reqsect, candp->source->ext))
+ continue;
+ if (index >= 0 && index != candp->add_index)
+ continue;
+ }
+#endif
global_manpath = is_global_mandir (candp->path);
if (!global_manpath)
drop_effective_privs ();
@@ -3739,9 +3859,51 @@ static int display_pages (struct candida
@@ -3739,9 +3868,56 @@ static int display_pages (struct candida
regain_effective_privs ();
if (found && !findall)
@ -167,13 +176,18 @@
+ fputs(_("find all matching manual pages"), stderr);
+ fputc('\n', stderr);
+
+ lext = NULL;
+ do {
+ struct mandata *info = candp->source;
+ if (lext && STREQ(lext, info->ext))
+ fprintf(stderr, " %c %s (%s+%d)", used, info->name, info->ext, candp->add_index);
+ else
+ fprintf(stderr, " %c %s (%s)", used, info->name, info->ext);
+ if (info->whatis) {
+ fprintf(stderr, "\t%s", info->whatis);
+ }
+ fputc('\n', stderr);
+ lext = info->ext;
+ used = ' ';
+ } while ((candp = candp->next));
+ fflush(stderr);

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Oct 29 12:55:03 UTC 2012 - werner@suse.de
- Make shadowed manual pages accessible (bnc#786679)
-------------------------------------------------------------------
Tue Oct 9 15:20:03 UTC 2012 - werner@suse.de