Oh well, I forgot to attach the patch.

  Jiri Palecek
Description: Fix "fortune all" returning no fortunes
 This patch fixes
 failure to load fortune files when "fortune all" is invoked. It was
 caused by loading the files from locpathname failed (because the
 .../local/... directory was empty) and the return value from that was
 used as the final return value of form_file_list, hiding that the
 previous call to load from /usr/share/games... succeeded.

Author: Jiri Palecek <jpale...@web.de>
Last-Update: 2017-02-28

Index: fortune-mod-1.99.1/fortune/fortune.c
===================================================================
--- fortune-mod-1.99.1.orig/fortune/fortune.c
+++ fortune-mod-1.99.1/fortune/fortune.c
@@ -977,9 +977,9 @@ int form_file_list(register char **files
         if (!ret)
          ret=add_file(percent, fullpathname, NULL, &File_list,
                         &File_tail, NULL);
-        if ( (!ret && fullpathname != locpathname) || strcmp(sp, "all") == 0 )
+        if ( (!ret && strcmp(fullpathname, locpathname) != 0 ) || strcmp(sp, 
"all") == 0 )
          ret=add_file(percent, locpathname, NULL, &File_list,
-                        &File_tail, NULL);
+                        &File_tail, NULL) || ret;
          
         if (!ret) {
           snprintf (locpathname, sizeof (locpathname), "%s/%s", getenv 
("PWD"), sp);

Reply via email to