From: Craig Andrews Date: Fri, 30 Dec 2016 16:25:09 +0000 (-0500) Subject: Patch from Gentoo X-Git-Tag: fortune-mod-1.99.4~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fheads%2Fcandrews-patch-1;p=fortune-mod Patch from Gentoo Gentoo has been carrying this patch for quite a while: https://github.com/gentoo/gentoo/blob/1c79f4dc1b1a367ecfc9324bf50f2558efdb2c45/games-misc/fortune-mod/files/01_all_fortune_all-fix.patch --- diff --git a/fortune-mod/fortune/fortune.c b/fortune-mod/fortune/fortune.c index aee68da..c0a34bc 100644 --- a/fortune-mod/fortune/fortune.c +++ b/fortune-mod/fortune/fortune.c @@ -990,7 +990,7 @@ int form_file_list(register char **files, register int file_cnt) if (!ret) ret=add_file(percent, fullpathname, NULL, &File_list, &File_tail, NULL); - if ( (!ret && fullpathname != locpathname) || strcmp(sp, "all") == 0 ) + if ( !ret && strncmp(fullpathname, locpathname, sizeof(fullpathname))) ret=add_file(percent, locpathname, NULL, &File_list, &File_tail, NULL); @@ -1001,7 +1001,8 @@ int form_file_list(register char **files, register int file_cnt) } if (!ret) return FALSE; - + if (strncmp(fullpathname, locpathname, sizeof(fullpathname)) && strcmp(sp, "all") == 0) + add_file(percent, locpathname, NULL, &File_list, &File_tail, NULL); } else if (!add_file(percent, fullpathname, NULL, &File_list,