From: Shlomi Fish Date: Tue, 10 Jan 2017 20:52:14 +0000 (+0200) Subject: incorporate most of the patch from Gentoo. X-Git-Tag: fortune-mod-1.99.5~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63993e5202a918f1b023edb79b549723b301cab6;p=fortune-mod incorporate most of the patch from Gentoo. 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 . --- diff --git a/fortune-mod/datfiles/Makefile b/fortune-mod/datfiles/Makefile index f53a082..2f03b89 100644 --- a/fortune-mod/datfiles/Makefile +++ b/fortune-mod/datfiles/Makefile @@ -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: diff --git a/fortune-mod/datfiles/off/Makefile b/fortune-mod/datfiles/off/Makefile index 46e1de3..75c757d 100644 --- a/fortune-mod/datfiles/off/Makefile +++ b/fortune-mod/datfiles/off/Makefile @@ -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: diff --git a/fortune-mod/fortune/fortune.c b/fortune-mod/fortune/fortune.c index bfb6867..2b20f13 100644 --- a/fortune-mod/fortune/fortune.c +++ b/fortune-mod/fortune/fortune.c @@ -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 @@ -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);