[SCM] Atari 2600 Emulator for SDL & the X Window System branch, master, updated. debian/3.2.1-1-1-g26502ed
Stephen Kitt
steve at sk2.org
Wed Sep 8 21:28:56 UTC 2010
The following commit has been merged in the master branch:
commit 26502ed44eb66c9b235c3b2868359c328412e3e6
Author: Stephen Kitt <steve at sk2.org>
Date: Wed Sep 8 23:28:46 2010 +0200
Avoid using MAXPATHLEN if it's not defined (as on hurd).
diff --git a/debian/changelog b/debian/changelog
index 59febb2..a707fa8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+stella (3.2.1-2) UNRELEASED; urgency=low
+
+ * Avoid requiring MAXPATHLEN (to build on hurd).
+
+ -- Stephen Kitt <steve at sk2.org> Wed, 08 Sep 2010 22:53:50 +0200
+
stella (3.2.1-1) experimental; urgency=low
* New upstream version.
diff --git a/debian/patches/02-kfreebsd-hurd-support.patch b/debian/patches/02-kfreebsd-hurd-support.patch
index f9f64c3..7185dd1 100644
--- a/debian/patches/02-kfreebsd-hurd-support.patch
+++ b/debian/patches/02-kfreebsd-hurd-support.patch
@@ -1,7 +1,11 @@
-Handle kfreebsd and hurd in the same way as other Unix variants.
+Handle kfreebsd and hurd in the same way as other Unix variants. On
+hurd, we can't use MAXPATHLEN since it doesn't exist, so use
+get_current_dir_name() instead; and since path names don't have a
+limit on length, removing the length check on the HOME environment
+variable doesn't weaken security.
-This patch will be sent upstream once it's been through a buildd
-run...
+This patch has been tested successfully on kfreebsd, but not yet on
+hurd; it will be sent upstream once that's done.
--- stella.orig/configure
+++ stella/configure
@@ -14,3 +18,43 @@ run...
DEFINES="$DEFINES -DUNIX"
_host_os=unix
;;
+--- stella.orig/src/unix/FSNodePOSIX.cxx
++++ stella/src/unix/FSNodePOSIX.cxx
+@@ -134,7 +134,11 @@
+ if ( p.length() >= 2 && p[0] == '~' && p[1] == '/')
+ {
+ const char *home = getenv("HOME");
+- if (home != NULL && strlen(home) < MAXPATHLEN)
++#ifdef MAXPATHLEN
++ if (home != NULL) && strlen(home) < MAXPATHLEN)
++#else // No MAXPATHLEN, as happens on Hurd
++ if (home != NULL)
++#endif
+ {
+ _path = home;
+ // Skip over the tilde. We know that p contains at least
+@@ -145,14 +149,22 @@
+ // Expand "./" to the current directory
+ else if ( p.length() >= 2 && p[0] == '.' && p[1] == '/')
+ {
++#ifdef MAXPATHLEN
+ char buf[MAXPATHLEN];
+ char* ret = getcwd(buf, MAXPATHLEN);
+- if (ret == buf)
++#else // No MAXPATHLEN, as happens on Hurd
++ char* ret = get_current_dir_name();
++ char* buf = ret;
++#endif
++ if (ret == buf && ret != NULL)
+ {
+ _path = buf;
+- // Skip over the tilda. We know that p contains at least
++ // Skip over the dot. We know that p contains at least
+ // two chars, so this is safe:
+ _path += p.c_str() + 1;
++#ifndef MAXPATHLEN
++ free(ret);
++#endif
+ }
+ }
+ else
--
Atari 2600 Emulator for SDL & the X Window System
More information about the Pkg-games-commits
mailing list