From a6aaf1d4f387445a128cb37629dfc39af9fffb46 Mon Sep 17 00:00:00 2001 From: jolan Date: Wed, 24 Jun 2009 14:19:06 +0000 Subject: [PATCH] remove patch that causes math.randomseed() to not function reported/debugged by M Joonas Pihlaja in pr 6176 --- lang/lua/Makefile | 3 ++- lang/lua/patches/patch-src_lmathlib_c | 21 --------------------- 2 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 lang/lua/patches/patch-src_lmathlib_c diff --git a/lang/lua/Makefile b/lang/lua/Makefile index 0c8d431101a..c578076a61d 100644 --- a/lang/lua/Makefile +++ b/lang/lua/Makefile @@ -1,8 +1,9 @@ -# $OpenBSD: Makefile,v 1.35 2008/11/07 12:23:12 jsg Exp $ +# $OpenBSD: Makefile,v 1.36 2009/06/24 14:19:06 jolan Exp $ COMMENT= powerful, light-weight programming language DISTNAME= lua-5.1.4 +PKGNAME= lua-5.1.4p0 CATEGORIES= lang MASTER_SITES= http://www.lua.org/ftp/ \ diff --git a/lang/lua/patches/patch-src_lmathlib_c b/lang/lua/patches/patch-src_lmathlib_c deleted file mode 100644 index 89483ca7665..00000000000 --- a/lang/lua/patches/patch-src_lmathlib_c +++ /dev/null @@ -1,21 +0,0 @@ -$OpenBSD: patch-src_lmathlib_c,v 1.1 2007/03/15 22:03:37 pedro Exp $ ---- src/lmathlib.c.orig Sun Mar 4 11:10:17 2007 -+++ src/lmathlib.c Sun Mar 4 11:11:40 2007 -@@ -181,7 +181,7 @@ static int math_max (lua_State *L) { - static int math_random (lua_State *L) { - /* the `%' avoids the (rare) case of r==1, and is needed also because on - some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */ -- lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; -+ lua_Number r = (lua_Number)(arc4random()%RAND_MAX) / (lua_Number)RAND_MAX; - switch (lua_gettop(L)) { /* check number of arguments */ - case 0: { /* no arguments */ - lua_pushnumber(L, r); /* Number between 0 and 1 */ -@@ -207,7 +207,7 @@ static int math_random (lua_State *L) { - - - static int math_randomseed (lua_State *L) { -- srand(luaL_checkint(L, 1)); -+ arc4random_stir(); - return 0; - } -