diff options
Diffstat (limited to 'sys-apps/man-db/files/man-db-2.5.7-non-gnu-nroff.patch')
-rw-r--r-- | sys-apps/man-db/files/man-db-2.5.7-non-gnu-nroff.patch | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/sys-apps/man-db/files/man-db-2.5.7-non-gnu-nroff.patch b/sys-apps/man-db/files/man-db-2.5.7-non-gnu-nroff.patch new file mode 100644 index 000000000000..4e93c44363f4 --- /dev/null +++ b/sys-apps/man-db/files/man-db-2.5.7-non-gnu-nroff.patch @@ -0,0 +1,97 @@ +fix from upstream for building w/out GNU nroff + +http://bugs.gentoo.org/309635 + +Wed Mar 24 11:04:46 GMT 2010 Colin Watson <cjwatson@debian.org> + + Fix build regression when GNU_NROFF is undefined (Savannah bug + #29318). + + * src/man.c (add_col): New function, split out from + make_display_command. + (make_roff_command): Reinstate tbl/col logic here, as by the time + we get to make_display_command we've forgotten whether tbl was + used. + (make_display_command): Remove tbl/col logic, useless here. Use + add_col. + +=== modified file 'src/man.c' +--- src/man.c 2010-03-21 22:05:16 +0000 ++++ src/man.c 2010-03-24 11:07:23 +0000 +@@ -43,6 +43,7 @@ + #include <string.h> + #include <stdlib.h> + #include <stdio.h> ++#include <stdarg.h> + #include <assert.h> + #include <errno.h> + #include <termios.h> +@@ -1406,6 +1407,26 @@ + return get_locale_charset (); + } + ++static void add_col (pipeline *p, const char *locale_charset, ...) ++{ ++ command *cmd; ++ va_list argv; ++ char *col_locale; ++ ++ cmd = command_new (COL); ++ va_start (argv, locale_charset); ++ command_argv (cmd, argv); ++ va_end (argv); ++ ++ col_locale = find_charset_locale (locale_charset); ++ if (col_locale) { ++ command_setenv (cmd, "LC_CTYPE", col_locale); ++ free (col_locale); ++ } ++ ++ pipeline_command (p, cmd); ++} ++ + /* Return pipeline to format file to stdout. */ + static pipeline *make_roff_command (const char *dir, const char *file, + pipeline *decomp, const char *dbfilters, +@@ -1699,6 +1720,11 @@ + !isatty (STDOUT_FILENO)) + /* we'll run col later, but prepare for it */ + setenv ("GROFF_NO_SGR", "1", 1); ++#ifndef GNU_NROFF ++ /* tbl needs col */ ++ else if (using_tbl && !troff && *COL) ++ add_col (p, locale_charset, NULL); ++#endif /* GNU_NROFF */ + } + } else { + /* use external formatter script, it takes arguments +@@ -1851,27 +1877,9 @@ + */ + const char *man_keep_formatting = + getenv ("MAN_KEEP_FORMATTING"); +- command *colcmd = NULL; + if ((!man_keep_formatting || !*man_keep_formatting) && + !isatty (STDOUT_FILENO)) +- colcmd = command_new_args ( +- COL, "-b", "-p", "-x", NULL); +-#ifndef GNU_NROFF +- /* tbl needs col */ +- else if (using_tbl && !troff && *COL) +- colcmd = command_new (COL); +-#endif /* GNU_NROFF */ +- +- if (colcmd) { +- char *col_locale = +- find_charset_locale (locale_charset); +- if (col_locale) { +- command_setenv (colcmd, "LC_CTYPE", +- col_locale); +- free (col_locale); +- } +- pipeline_command (p, colcmd); +- } ++ add_col (p, locale_charset, "-b", "-p", "-x", NULL); + } + + if (ascii) { + |