pkgsrc/devel/allegro/patches/patch-ax
2007-01-04 00:15:03 +00:00

25 lines
1,001 B
Text

$NetBSD: patch-ax,v 1.4 2007/01/04 00:15:03 wiz Exp $
--- src/unix/usystem.c.orig 2005-09-04 16:00:17.000000000 +0000
+++ src/unix/usystem.c
@@ -130,6 +130,7 @@ int _unix_find_resource(char *dest, AL_C
}
/* if it is a .dat, look in /usr/share/ and /usr/local/share/ */
+ /* and @@PREFIX@@/share in NetBSD */
if (ustricmp(get_extension(resource), uconvert_ascii("dat", tmp)) == 0) {
ustrzcpy(buf, sizeof(buf), uconvert_ascii("/usr/share/allegro/", tmp));
ustrzcat(buf, sizeof(buf), resource);
@@ -137,6 +138,12 @@ int _unix_find_resource(char *dest, AL_C
ustrzcpy(dest, size, buf);
return 0;
}
+ ustrzcpy(buf, sizeof(buf), uconvert_ascii("@@PREFIX@@/share/allegro/", tmp));
+ ustrzcat(buf, sizeof(buf), resource);
+ if (exists(buf)) {
+ ustrzcpy(dest, size, buf);
+ return 0;
+ }
ustrzcpy(buf, sizeof(buf), uconvert_ascii("/usr/local/share/allegro/", tmp));
ustrzcat(buf, sizeof(buf), resource);
if (exists(buf)) {