pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/SDL Fix patch-aa to correctly use strcat, and to...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/82d9410d71c3
branches:  trunk
changeset: 519723:82d9410d71c3
user:      ben <ben%pkgsrc.org@localhost>
date:      Sun Oct 08 18:40:23 2006 +0000

description:
Fix patch-aa to correctly use strcat, and to be C89 compliant.
Patch supplied by Christian Biere in PR#34738.

diffstat:

 devel/SDL/distinfo         |   4 +-
 devel/SDL/patches/patch-aa |  51 +++++++++++++++++++++++----------------------
 2 files changed, 28 insertions(+), 27 deletions(-)

diffs (82 lines):

diff -r 62a3cd160da3 -r 82d9410d71c3 devel/SDL/distinfo
--- a/devel/SDL/distinfo        Sun Oct 08 17:48:30 2006 +0000
+++ b/devel/SDL/distinfo        Sun Oct 08 18:40:23 2006 +0000
@@ -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 -r 62a3cd160da3 -r 82d9410d71c3 devel/SDL/patches/patch-aa
--- a/devel/SDL/patches/patch-aa        Sun Oct 08 17:48:30 2006 +0000
+++ b/devel/SDL/patches/patch-aa        Sun Oct 08 18:40:23 2006 +0000
@@ -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
-+};
++static void *get_dlopen_handle(const char *sofile)
++{
++      static const char * const libdirs[] = {
++              PREFIX "/lib/",
++              X11BASE "/lib/",
++      };
++      unsigned i;
++      void *handle;
++
++      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) - strlen(buf) - 1);
++
++              handle = dlopen(buf, RTLD_NOW);
++              if (handle)
++                      break;
++      }
++      return handle;
++}
 +
  void *SDL_LoadObject(const char *sofile)
  {
 -      void *handle = dlopen(sofile, RTLD_NOW);
-+      int i;
-+      void *handle;
-+
-+      i = 0;
-+      handle = NULL;
-+      while (libdirs[i] != NULL && handle == NULL) {
-+              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';
-+
-+              handle = dlopen(buf, RTLD_NOW);
-+
-+              i++;
-+      }
++      void *handle = get_dlopen_handle(sofile);
        const char *loaderror = (char *)dlerror();
        if ( handle == NULL ) {
                SDL_SetError("Failed loading %s: %s", sofile, loaderror);



Home | Main Index | Thread Index | Old Index