Submited by: William Immendorf <will.immendorf@gmail.com>
Date: 2010-05-07
Inital Package Version: 2.5.7
Origin: Upstream commit 1199, http://bazaar.launchpad.net/~cjwatson/man-db/trunk/revision/1199
Upstream Status: From Upstream Bazaar
Description: This fixes a issue in when you try to view certan man pages with man (I've seen this happen with ifort's man page, this acually
happend to me when I was trying to test out various forigen language man pages), man errors out with this message:
man: man.c:2393: display: Assertion `decomp->ncommands == 1' failed. Aborted
Aborted
and then quits. This is a issue specific to Man-DB-2.5.7, 2.5.6 diddn't have this issue. This is a well known issue and will be fixed with the release of Man-DB-2.5.8.
diff -Naur man-db-2.5.7.orig/lib/pipeline.c man-db-2.5.7/lib/pipeline.c
old
|
new
|
|
329 | 329 | return cmd; |
330 | 330 | } |
331 | 331 | |
| 332 | static void passthrough (void *data ATTRIBUTE_UNUSED) |
| 333 | { |
| 334 | for (;;) { |
| 335 | char buffer[4096]; |
| 336 | int r = read (STDIN_FILENO, buffer, 4096); |
| 337 | if (r <= 0) |
| 338 | break; |
| 339 | if (fwrite (buffer, 1, (size_t) r, stdout) < (size_t) r) |
| 340 | break; |
| 341 | } |
| 342 | |
| 343 | return; |
| 344 | } |
| 345 | |
| 346 | command *command_new_passthrough (void) |
| 347 | { |
| 348 | return command_new_function ("cat", &passthrough, NULL, NULL); |
| 349 | } |
| 350 | |
332 | 351 | command *command_dup (command *cmd) |
333 | 352 | { |
334 | 353 | command *newcmd = XMALLOC (command); |
… |
… |
|
831 | 850 | return p; |
832 | 851 | } |
833 | 852 | |
834 | | static void passthrough (void *data ATTRIBUTE_UNUSED) |
835 | | { |
836 | | for (;;) { |
837 | | char buffer[4096]; |
838 | | int r = read (STDIN_FILENO, buffer, 4096); |
839 | | if (r <= 0) |
840 | | break; |
841 | | if (fwrite (buffer, 1, (size_t) r, stdout) < (size_t) r) |
842 | | break; |
843 | | } |
844 | | |
845 | | return; |
846 | | } |
847 | | |
848 | 853 | void pipeline_connect (pipeline *source, pipeline *sink, ...) |
849 | 854 | { |
850 | 855 | va_list argv; |
… |
… |
|
876 | 881 | * because it has nowhere to send output. Until this is |
877 | 882 | * fixed, this kludge is necessary. |
878 | 883 | */ |
879 | | if (arg->ncommands == 0) { |
880 | | command *cmd = command_new_function |
881 | | ("cat", &passthrough, NULL, NULL); |
882 | | pipeline_command (arg, cmd); |
883 | | } |
| 884 | if (arg->ncommands == 0) |
| 885 | pipeline_command (arg, command_new_passthrough ()); |
884 | 886 | } |
885 | 887 | va_end (argv); |
886 | 888 | } |
diff -Naur man-db-2.5.7.orig/lib/pipeline.h man-db-2.5.7/lib/pipeline.h
old
|
new
|
|
172 | 172 | */ |
173 | 173 | command *command_new_sequence (const char *name, ...) ATTRIBUTE_SENTINEL; |
174 | 174 | |
| 175 | /* Return a new command that just passes data from its input to its output. */ |
| 176 | command *command_new_passthrough (void); |
| 177 | |
175 | 178 | /* Return a duplicate of a command. */ |
176 | 179 | command *command_dup (command *cmd); |
177 | 180 | |
diff -Naur man-db-2.5.7.orig/NEWS man-db-2.5.7/NEWS
old
|
new
|
|
| 1 | man-db 2.5.8 |
| 2 | ============ |
| 3 | |
| 4 | Major changes since man-db 2.5.7: |
| 5 | |
| 6 | Fixes: |
| 7 | ------ |
| 8 | |
| 9 | o Fix assertion failure on 'man -l' with an uncompressed page and |
| 10 | any of --no-hyphenation, --no-justification, or a non-English |
| 11 | page. |
| 12 | |
1 | 13 | man-db 2.5.7 (16 February 2010) |
2 | 14 | =============================== |
3 | 15 | |
diff -Naur man-db-2.5.7.orig/src/man.c man-db-2.5.7/src/man.c
old
|
new
|
|
2390 | 2390 | #endif /* TROFF_IS_GROFF */ |
2391 | 2391 | |
2392 | 2392 | if (seq->u.sequence.ncommands) { |
2393 | | assert (decomp->ncommands == 1); |
2394 | | command_sequence_command (seq, decomp->commands[0]); |
2395 | | decomp->commands[0] = seq; |
| 2393 | assert (decomp->ncommands <= 1); |
| 2394 | if (decomp->ncommands) { |
| 2395 | command_sequence_command |
| 2396 | (seq, decomp->commands[0]); |
| 2397 | decomp->commands[0] = seq; |
| 2398 | } else { |
| 2399 | command_sequence_command |
| 2400 | (seq, command_new_passthrough ()); |
| 2401 | pipeline_command (decomp, seq); |
| 2402 | } |
2396 | 2403 | } else |
2397 | 2404 | command_free (seq); |
2398 | 2405 | } |