r3884 - packages/trunk/a7xpg/debian/patches

Peter De Wachter pdewacht-guest at alioth.debian.org
Sun Aug 26 22:45:56 UTC 2007


Author: pdewacht-guest
Date: 2007-08-26 22:45:56 +0000 (Sun, 26 Aug 2007)
New Revision: 3884

Modified:
   packages/trunk/a7xpg/debian/patches/07_store_prefs_in_home_dir.diff
Log:
check getenv("HOME") != null


Modified: packages/trunk/a7xpg/debian/patches/07_store_prefs_in_home_dir.diff
===================================================================
--- packages/trunk/a7xpg/debian/patches/07_store_prefs_in_home_dir.diff	2007-08-26 21:56:17 UTC (rev 3883)
+++ packages/trunk/a7xpg/debian/patches/07_store_prefs_in_home_dir.diff	2007-08-26 22:45:56 UTC (rev 3884)
@@ -3,9 +3,10 @@
 
 Sun Aug 26 00:00:45 CEST 2007  pdewacht at gmail.com
   * 07_store_prefs_in_home_dir
-diff -rN -u old-a7xpg/src/abagames/a7xpg/A7xPrefManager.d new-a7xpg/src/abagames/a7xpg/A7xPrefManager.d
---- old-a7xpg/src/abagames/a7xpg/A7xPrefManager.d	2007-08-26 00:03:22.000000000 +0200
-+++ new-a7xpg/src/abagames/a7xpg/A7xPrefManager.d	2007-08-26 00:03:22.000000000 +0200
+Index: a7xpg_0.11.dfsg1/src/abagames/a7xpg/A7xPrefManager.d
+===================================================================
+--- a7xpg_0.11.dfsg1.orig/src/abagames/a7xpg/A7xPrefManager.d	2007-08-26 23:45:46.000000000 +0200
++++ a7xpg_0.11.dfsg1/src/abagames/a7xpg/A7xPrefManager.d	2007-08-26 23:47:15.000000000 +0200
 @@ -5,7 +5,9 @@
   */
  module abagames.a7xpg.A7xPrefManager;
@@ -17,7 +18,7 @@
  import abagames.util.PrefManager;
  
  /**
-@@ -14,18 +16,22 @@
+@@ -14,18 +16,25 @@
  public class A7xPrefManager: PrefManager {
   public:
    static const int VERSION_NUM = 10;
@@ -30,7 +31,10 @@
    }
  
 +  public char[] pref_file() {
-+    return format("%s/%s", std.string.toString(getenv("HOME")), PREF_FILE);
++    char * home = getenv("HOME");
++    if (home is null)
++      throw new Error("HOME environment variable is not defined");
++    return std.string.toString(home) ~ "/" ~ PREF_FILE;
 +  }
 +
    public void load() {
@@ -42,7 +46,7 @@
        fd.read(ver);
        if (ver != VERSION_NUM)
  	throw new Error("Wrong version num");
-@@ -39,7 +45,7 @@
+@@ -39,7 +48,7 @@
  
    public void save() {
      auto File fd = new File;
@@ -51,4 +55,3 @@
      fd.write(VERSION_NUM);
      fd.write(hiScore);
      fd.close();
-




More information about the Pkg-games-commits mailing list