summaryrefslogtreecommitdiff
path: root/devel/SDL
diff options
context:
space:
mode:
authorben <ben@pkgsrc.org>2006-10-08 18:40:23 +0000
committerben <ben@pkgsrc.org>2006-10-08 18:40:23 +0000
commit4a6b339bdcc32b4968d4ab9b8afead96a7767f8e (patch)
tree5488fe21e55f5e249642964558c261f404adff6e /devel/SDL
parent9af81a7cb21a9c1de06f2037508d72db14d48871 (diff)
downloadpkgsrc-4a6b339bdcc32b4968d4ab9b8afead96a7767f8e.tar.gz
Fix patch-aa to correctly use strcat, and to be C89 compliant.
Patch supplied by Christian Biere in PR#34738.
Diffstat (limited to 'devel/SDL')
-rw-r--r--devel/SDL/distinfo4
-rw-r--r--devel/SDL/patches/patch-aa41
2 files changed, 23 insertions, 22 deletions
diff --git a/devel/SDL/distinfo b/devel/SDL/distinfo
index a7aefdaf233..55c64b3d91d 100644
--- a/devel/SDL/distinfo
+++ b/devel/SDL/distinfo
@@ -1,9 +1,9 @@
-$NetBSD: distinfo,v 1.46 2006/08/03 20:21:20 rillig Exp $
+$NetBSD: distinfo,v 1.47 2006/10/08 18:40:23 ben Exp $
SHA1 (SDL-1.2.11.tar.gz) = 2259134d714e35ab1469d513674a3cd02510d198
RMD160 (SDL-1.2.11.tar.gz) = 91dc8877224415a4ba59e1de57c31861e550d644
Size (SDL-1.2.11.tar.gz) = 2796407 bytes
-SHA1 (patch-aa) = 04894f421f6e56ca7967c70afba5e361dcd72b14
+SHA1 (patch-aa) = 5a3b922c1ad64837d2bc1461723e4f34622b481f
SHA1 (patch-aj) = 21b77004d782b5da7973e8ccb8bdd686efca1684
SHA1 (patch-am) = 0a99757ca6dbed3f46c6ed2a04a3e65d81f92b3b
SHA1 (patch-an) = 2bb3ca98579ce38e055f789664ed8d71881c1288
diff --git a/devel/SDL/patches/patch-aa b/devel/SDL/patches/patch-aa
index 36dec355f2e..6338460d37f 100644
--- a/devel/SDL/patches/patch-aa
+++ b/devel/SDL/patches/patch-aa
@@ -1,37 +1,38 @@
-$NetBSD: patch-aa,v 1.13 2006/07/01 19:08:36 jmmv Exp $
+$NetBSD: patch-aa,v 1.14 2006/10/08 18:40:23 ben Exp $
---- src/loadso/dlopen/SDL_sysloadso.c.orig 2006-05-01 10:02:37.000000000 +0200
+--- src/loadso/dlopen/SDL_sysloadso.c.orig 2006-05-01 01:02:37.000000000 -0700
+++ src/loadso/dlopen/SDL_sysloadso.c
-@@ -31,9 +31,31 @@
+@@ -31,9 +31,32 @@
#include "SDL_loadso.h"
-+const char *libdirs[] = {
-+ PREFIX "/lib/",
-+ X11BASE "/lib/",
-+ NULL
-+};
-+
- void *SDL_LoadObject(const char *sofile)
- {
-- void *handle = dlopen(sofile, RTLD_NOW);
-+ int i;
++static void *get_dlopen_handle(const char *sofile)
++{
++ static const char * const libdirs[] = {
++ PREFIX "/lib/",
++ X11BASE "/lib/",
++ };
++ unsigned i;
+ void *handle;
+
-+ i = 0;
-+ handle = NULL;
-+ while (libdirs[i] != NULL && handle == NULL) {
++ for (i = 0; i < sizeof libdirs / sizeof libdirs[0]; i++) {
+ char buf[1024];
+
+ strncpy(buf, libdirs[i], sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = '\0';
-+ strncat(buf, sofile, sizeof(buf) - 1);
-+ buf[sizeof(buf) - 1] = '\0';
++ strncat(buf, sofile, sizeof(buf) - strlen(buf) - 1);
+
+ handle = dlopen(buf, RTLD_NOW);
-+
-+ i++;
++ if (handle)
++ break;
+ }
++ return handle;
++}
++
+ void *SDL_LoadObject(const char *sofile)
+ {
+- void *handle = dlopen(sofile, RTLD_NOW);
++ void *handle = get_dlopen_handle(sofile);
const char *loaderror = (char *)dlerror();
if ( handle == NULL ) {
SDL_SetError("Failed loading %s: %s", sofile, loaderror);