r3882 - packages/trunk/torus-trooper/debian/patches
Peter De Wachter
pdewacht-guest at alioth.debian.org
Sun Aug 26 21:25:28 UTC 2007
Author: pdewacht-guest
Date: 2007-08-26 21:25:28 +0000 (Sun, 26 Aug 2007)
New Revision: 3882
Modified:
packages/trunk/torus-trooper/debian/patches/dotfile.patch
Log:
check getenv("HOME") != null
Modified: packages/trunk/torus-trooper/debian/patches/dotfile.patch
===================================================================
--- packages/trunk/torus-trooper/debian/patches/dotfile.patch 2007-08-26 21:15:57 UTC (rev 3881)
+++ packages/trunk/torus-trooper/debian/patches/dotfile.patch 2007-08-26 21:25:28 UTC (rev 3882)
@@ -1,7 +1,7 @@
Index: torus-trooper_0.22.dfsg1/src/abagames/tt/prefmanager.d
===================================================================
---- torus-trooper_0.22.dfsg1.orig/src/abagames/tt/prefmanager.d 2007-08-26 22:37:04.000000000 +0200
-+++ torus-trooper_0.22.dfsg1/src/abagames/tt/prefmanager.d 2007-08-26 22:37:09.000000000 +0200
+--- torus-trooper_0.22.dfsg1.orig/src/abagames/tt/prefmanager.d 2007-08-26 22:38:00.000000000 +0200
++++ torus-trooper_0.22.dfsg1/src/abagames/tt/prefmanager.d 2007-08-26 23:17:40.000000000 +0200
@@ -6,6 +6,9 @@
module abagames.tt.prefmanager;
@@ -12,12 +12,15 @@
private import abagames.util.prefmanager;
private import abagames.tt.ship;
-@@ -22,11 +25,20 @@
+@@ -22,11 +25,23 @@
_prefData = new PrefData;
}
+ public static char[] pref_dir() {
-+ char[] dir = std.string.toString(getenv("HOME")) ~ "/.torus-trooper";
++ char * home = getenv("HOME");
++ if (home is null)
++ throw new Error("HOME environment variable is not defined");
++ char[] dir = std.string.toString(home) ~ "/.torus-trooper";
+ try {
+ mkdir(dir);
+ } catch (FileException e) {
@@ -34,7 +37,7 @@
fd.read(ver);
if (ver != VERSION_NUM)
throw new Error("Wrong version num");
-@@ -41,7 +53,7 @@
+@@ -41,7 +56,7 @@
public void save() {
auto File fd = new File;
@@ -45,8 +48,8 @@
fd.close();
Index: torus-trooper_0.22.dfsg1/src/abagames/tt/replay.d
===================================================================
---- torus-trooper_0.22.dfsg1.orig/src/abagames/tt/replay.d 2007-08-26 22:37:04.000000000 +0200
-+++ torus-trooper_0.22.dfsg1/src/abagames/tt/replay.d 2007-08-26 22:37:51.000000000 +0200
+--- torus-trooper_0.22.dfsg1.orig/src/abagames/tt/replay.d 2007-08-26 22:38:00.000000000 +0200
++++ torus-trooper_0.22.dfsg1/src/abagames/tt/replay.d 2007-08-26 22:38:06.000000000 +0200
@@ -7,13 +7,13 @@
private import std.stream;
More information about the Pkg-games-commits
mailing list