]> granicus.if.org Git - fortune-mod/commitdiff
incorporate most of the patch from Gentoo.
authorShlomi Fish <shlomif@shlomifish.org>
Tue, 10 Jan 2017 20:52:14 +0000 (22:52 +0200)
committerShlomi Fish <shlomif@shlomifish.org>
Tue, 10 Jan 2017 20:52:14 +0000 (22:52 +0200)
See:

* https://github.com/gentoo/gentoo/blob/1c79f4dc1b1a367ecfc9324bf50f2558efdb2c45/games-misc/fortune-mod/files/fortune-mod-1.99.1-gentoo.patch

* https://github.com/shlomif/fortune-mod/issues/7 .

fortune-mod/datfiles/Makefile
fortune-mod/datfiles/off/Makefile
fortune-mod/fortune/fortune.c

index f53a082fec42379be006cbe87a9d818d011e1f6d..2f03b891b9b52e01e6a940d91b694b4dc3fd3685 100644 (file)
@@ -51,7 +51,7 @@ install: cookies-stamp
        if [ $(WEB) = 1 ] ; then cd html && $(MAKE) install ; fi
        for i in $(COOKIES) ; do \
                install -m 0644 $$i $$i.dat $(COOKIEDIR) || exit $? ; \
-               cp -d $$i.u8 $(COOKIEDIR) ; \
+               cp -P $$i.u8 $(COOKIEDIR) ; \
                done
 
 clean:
index 46e1de3daaa4fed83921bfc0cba3708f223701ce..75c757dc856a29629858d2a995ed4fc182cb0f70 100644 (file)
@@ -36,7 +36,7 @@ install:
        install -m 0755 -d $(OCOOKIEDIR)
        for i in $(OCOOKIES) ; \
            do install -m 0644 rotated/$$i rotated/$$i.dat $(OCOOKIEDIR) || exit $$? ; \
-           cp -d rotated/$$i.u8 $(OCOOKIEDIR) ; \
+           cp -P rotated/$$i.u8 $(OCOOKIEDIR) ; \
        done
 
 clean:
index bfb68674b18a81300bb827fb0a062746e1b7347e..2b20f1358d396a152fb76e2e1544e3e3366eb99f 100644 (file)
@@ -97,7 +97,7 @@ static char rcsid[] = "$NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $";
 #endif /* killing warnings */
 
 #define         PROGRAM_NAME            "fortune-mod"
-#define         PROGRAM_VERSION         "9708"
+#define         PROGRAM_VERSION         "1.99.4"
 
 #include <stdbool.h>
 
@@ -1678,8 +1678,14 @@ int main(int ac, char *av[])
 
     setlocale(LC_ALL,"");
     ctype = nl_langinfo(CODESET);
-    if(strcmp(ctype,"ANSI_X3.4-1968") == 0)
+    if (!ctype || !*ctype)
+    {
+        ctype = "C";
+    }
+    else if(strcmp(ctype,"ANSI_X3.4-1968") == 0)
+    {
         ctype="ISO-8859-1";
+    }
 
     crequest = malloc(strlen(ctype) + 7 + 1);
     sprintf(crequest, "UTF-8..%s", ctype);