From coolaz@web.de  Sun Aug  8 19:04:15 2004
Return-Path: <coolaz@web.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 963E716A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  8 Aug 2004 19:04:15 +0000 (GMT)
Received: from smtp05.web.de (smtp05.web.de [217.72.192.209])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 627AE43D5F
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  8 Aug 2004 19:04:15 +0000 (GMT)
	(envelope-from coolaz@web.de)
Received: from [145.254.34.127] (helo=thunderBSD.tld)
	by smtp05.web.de with asmtp (TLSv1:DES-CBC3-SHA:168)
	(WEB.DE 4.101 #44)
	id 1Btsxp-00058u-00; Sun, 08 Aug 2004 21:04:14 +0200
Received: from thunderBSD.tld (localhost [127.0.0.1])
	by thunderBSD.tld (8.12.11/8.12.11) with ESMTP id i78J7dUW000887;
	Sun, 8 Aug 2004 21:07:40 +0200 (CEST)
	(envelope-from martin@thunderBSD.tld)
Received: (from martin@localhost)
	by thunderBSD.tld (8.12.11/8.12.11/Submit) id i78IivOs000684;
	Sun, 8 Aug 2004 20:44:57 +0200 (CEST)
	(envelope-from martin)
Message-Id: <200408081844.i78IivOs000684@thunderBSD.tld>
Date: Sun, 8 Aug 2004 20:44:57 +0200 (CEST)
From: Martin Kulas <coolaz@web.de>
Sender: coolaz@web.de
Reply-To: coolaz@web.de
To: FreeBSD-gnats-submit@FreeBSD.org
Cc: localtux@yahoo.de
Subject: [patch] fortune -e implementation bug
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         70182
>Category:       bin
>Synopsis:       [patch] fortune(6) -e implementation bug
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 08 19:10:07 GMT 2004
>Closed-Date:    Mon Jul 14 10:50:06 UTC 2008
>Last-Modified:  Mon Jul 14 11:00:17 UTC 2008
>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:
State-Changed-From-To: open->analyzed 
State-Changed-By: edwin 
State-Changed-When: Sun Nov 4 10:45:11 UTC 2007 
State-Changed-Why:  
Patch for -CURRENT 

--- a/games/fortune/fortune/fortune.c 
+++ b/games/fortune/fortune/fortune.c 
@@ -898,7 +898,7 @@ init_prob() 
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; 



Responsible-Changed-From-To: freebsd-bugs->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Nov 4 10:45:11 UTC 2007 
Responsible-Changed-Why:  
Wait for mentor approval. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70182 
State-Changed-From-To: analyzed->patched 
State-Changed-By: edwin 
State-Changed-When: Tue Nov 6 22:03:39 UTC 2007 
State-Changed-Why:  
Commited to HEAD 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70182 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/70182: commit references a PR
Date: Tue,  6 Nov 2007 22:04:14 +0000 (UTC)

 edwin       2007-11-06 22:03:24 UTC
 
   FreeBSD src repository
 
   Modified files:
     games/fortune/fortune fortune.c 
   Log:
   games/fortune: add FORTUNE_PATH env var, so ports of fortunes can work sanely
   
           This patch adds an environment variable FORTUNE_PATH, which
           works like PATH for fortune files.
   
   PR:             bin/36867
   Submitted by:   Alan Eldridge <ports@geeksrus.net>
   
   [patch] fortune -e implementation bug
   
           Fix the behaviour of "-e file1 file2" to equally pick them
           instead of only picking the first one.
   
   PR:             bin/70182
   Submitted by:   Martin Kulas <coolaz@web.de>
   
   MFC after:      1 week
   Approved by:    grog (mentor)
   
   Revision  Changes    Path
   1.30      +106 -14   src/games/fortune/fortune/fortune.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
Responsible-Changed-From-To: edwin->freebsd-bugs 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Feb 14 10:27:36 UTC 2008 
Responsible-Changed-Why:  

Give back into the pool until later. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70182 
State-Changed-From-To: patched->closed 
State-Changed-By: edwin 
State-Changed-When: Mon Jul 14 10:49:48 UTC 2008 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70182 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/70182: commit references a PR
Date: Mon, 14 Jul 2008 10:49:19 +0000 (UTC)

 edwin       2008-07-14 10:49:01 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     games/fortune/fortune fortune.6 fortune.c 
   Log:
   SVN rev 180505 on 2008-07-14 10:49:01Z by edwin
   
   MFC of revision 173401, 173414 and 173396:
   
   gaames/fortune: add FORTUNE_PATH env var, so ports of fortunes can work sanely
   
           This patch adds an environment variable FORTUNE_PATH, which
           works like PATH for fortune files.
   
   PR:             bin/36867
   Submitted by:   Alan Eldridge <ports@geeksrus.net>
   
   [patch] fortune -e implementation bug
   
           Fix the behaviour of "-e file1 file2" to equally pick them
           instead of only picking the first one.
   
   PR:             bin/70182
   Submitted by:   Martin Kulas <coolaz@web.de>
   
   Revision   Changes    Path
   1.20.10.1  +36 -31    src/games/fortune/fortune/fortune.6
   1.29.2.1   +117 -19   src/games/fortune/fortune/fortune.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/70182: commit references a PR
Date: Mon, 14 Jul 2008 10:50:03 +0000 (UTC)

 edwin       2008-07-14 10:49:32 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     games/fortune/fortune fortune.6 fortune.c 
   Log:
   SVN rev 180506 on 2008-07-14 10:49:32Z by edwin
   
   MFC of revision 173401, 173414 and 173396:
   
   gaames/fortune: add FORTUNE_PATH env var, so ports of fortunes can work sanely
   
           This patch adds an environment variable FORTUNE_PATH, which
           works like PATH for fortune files.
   
   PR:             bin/36867
   Submitted by:   Alan Eldridge <ports@geeksrus.net>
   
   [patch] fortune -e implementation bug
   
           Fix the behaviour of "-e file1 file2" to equally pick them
           instead of only picking the first one.
   
   PR:             bin/70182
   Submitted by:   Martin Kulas <coolaz@web.de>
   
   Revision  Changes    Path
   1.20.2.1  +36 -31    src/games/fortune/fortune/fortune.6
   1.27.2.1  +117 -19   src/games/fortune/fortune/fortune.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
