Bug#856384: fortune-mod: fortune all fails to load any cookies
Package: fortune-mod Version: 1:1.99.1-7.1 Followup-For: Bug #856384 Dear Maintainer, * What led up to the situation? Running fortune all * What exactly did you do (or not do) that was effective (or ineffective)? Running fortune all * What was the outcome of this action? Error message * What outcome did you expect instead? A fortune cookie being displayed this bug still exists in the current Debian/testing distribution. When executing fortune all, the program shows this output: adrian@g6 ~ % fortune all No fortunes found I can execute fortune all without any issues on NetBSD and FreeBSD, where a cookie is shown by running fortune all. The error exists on both of my Debian/testing installations. Thank you for your kind attention. Adrian Kieß -- System Information: Debian Release: 11.0 APT prefers testing APT policy: (990, 'testing'), (550, 'unstable'), (500, 'testing-security') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 5.10.0-7-amd64 (SMP w/4 CPU threads) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to fr_FR.UTF-8), LANGUAGE not set Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages fortune-mod depends on: ii libc6 2.31-12 ii librecode0 3.6-24 Versions of packages fortune-mod recommends: ii fortunes [fortune-cookie-db] 1:1.99.1-7.1 ii fortunes-bg [fortune-cookie-db]1.3+nmu1 ii fortunes-bofh-excuses [fortune-cookie-db] 1.2-3 ii fortunes-de [fortune-cookie-db]0.34-1 ii fortunes-debian-hints [fortune-cookie-db] 2.01.3 ii fortunes-fr [fortune-cookie-db]0.65+nmu3 ii fortunes-it-off [fortune-cookie-db]1.99-4.1 ii fortunes-min [fortune-cookie-db] 1:1.99.1-7.1 ii fortunes-off [fortune-cookie-db] 1:1.99.1-7.1 ii fortunes-ru [fortune-cookie-db]1.52-3.1 Versions of packages fortune-mod suggests: ii bsdmainutils 12.1.7+nmu3 ii fortunes 1:1.99.1-7.1 ii x11-utils 7.7+5
Bug#856384: fortune-mod: fortune all fails to load any cookies
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 PalecekLast-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, _list, _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, _list, -_tail, NULL); +_tail, NULL) || ret; if (!ret) { snprintf (locpathname, sizeof (locpathname), "%s/%s", getenv ("PWD"), sp);
Bug#856384: fortune-mod: fortune all fails to load any cookies
Package: fortune-mod Version: 1:1.99.1-7 Severity: normal Tags: patch File: /usr/games/fortune Dear Maintainer, on my system, running $ fortune all gives an error message "No fortunes found", despite fortune database is normally installed. I think this is a bug that should be fixed. I have debugged this and in the attachment, you'll find a patch that fixes this bug. It was a simple problem where failure to load fortune cookies from the local directory overruled successful loading from the normal directory. Regards Jiri Palecek -- System Information: Debian Release: 9.0 APT prefers testing APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'unstable'), (1, 'experimental-debug'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 4.9.0-2-686-pae (SMP w/2 CPU cores) Locale: LANG=cs_CZ, LC_CTYPE=cs_CZ (charmap=ISO-8859-2) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages fortune-mod depends on: ii libc6 2.24-9 ii librecode0 3.6-23 Versions of packages fortune-mod recommends: ii fortunes [fortune-cookie-db] 1:1.99.1-7 ii fortunes-bofh-excuses [fortune-cookie-db] 1.2-2 ii fortunes-cs [fortune-cookie-db]2.0.9-1 ii fortunes-debian-hints [fortune-cookie-db] 2.01 ii fortunes-min [fortune-cookie-db] 1:1.99.1-7 Versions of packages fortune-mod suggests: ii bsdmainutils 9.0.12 ii fortunes 1:1.99.1-7 ii x11-utils 7.7+3 -- no debconf information