bin/70182: [patch] fortune -e implementation bug
Martin Kulas
coolaz at web.de
Sun Aug 8 12:10:07 PDT 2004
>Number: 70182
>Category: bin
>Synopsis: [patch] fortune -e implementation bug
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Aug 08 19:10:07 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Martin Kulas
>Release: FreeBSD 4.10-RELEASE i386
>Organization:
None
>Environment:
System: FreeBSD 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Sat Jun 19 23:12:40 CEST 2004 i386
>Description:
If I type ``fortune -e murphy startrek'' several times, ich will get only
messages from ``murphy'' but not from ``startrek''. If I understand the
``-e'' flag correctly, this flag should treat all fortune files equally.
>How-To-Repeat:
Just type ``fortune -e murphy startrek'' and you will not get any message
from ``startrek''.
>Fix:
Apply the following patch:
<patch>
--- fortune.c.orig Fri Aug 6 15:13:28 2004
+++ fortune.c Sun Aug 8 00:51:38 2004
@@ -933,7 +933,7 @@
if (num_noprob > 1) {
frac = percent / num_noprob;
DPRINTF(1, (stderr, ", frac = %d%%", frac));
- for (fp = File_list; fp != last; fp = fp->next)
+ for (fp = File_tail; fp != last; fp = fp->prev)
if (fp->percent == NO_PROB) {
fp->percent = frac;
percent -= frac;
</patch>
Now ``murphy'' and ``startrek'' are treated equally.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list