]> granicus.if.org Git - fortune-mod/commitdiff
Patch from Gentoo candrews-patch-1
authorCraig Andrews <candrews@integralblue.com>
Fri, 30 Dec 2016 16:25:09 +0000 (11:25 -0500)
committerGitHub <noreply@github.com>
Fri, 30 Dec 2016 16:25:09 +0000 (11:25 -0500)
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

fortune-mod/fortune/fortune.c

index aee68dac4ca9d586a59f6dfd3427b4b89b8ba11b..c0a34bcc8a481ef6ddce2d4908829b868e838e3c 100644 (file)
@@ -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,