File: change-configuration-path.patch

package info (click to toggle)
etw 3.6%2Bsvn162-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,700 kB
  • sloc: ansic: 31,633; objc: 244; sh: 97; makefile: 42
file content (32 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Markus Koschany <apo@debian.org>
Date: Thu, 22 Nov 2012 18:37:41 +0100
Subject: change-configuration-path

Per default the configuration is loaded from /usr/share/games/etw instead
of $HOME/.etw/. This patch fixes the issue.
---
 etw/menu_config.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/etw/menu_config.c b/etw/menu_config.c
index 9f1ef30..163b8c2 100644
--- a/etw/menu_config.c
+++ b/etw/menu_config.c
@@ -372,9 +372,16 @@ void load_config(FILE *f)
 void read_menu_config(void)
 {
     FILE *f;
+    char path[1024];
+    snprintf(path, 1024, "%setw.cfg", TEMP_DIR);
+
     D(bug("Reading configuration...\n"/*-*/));
 
-    f=fopen("etw.cfg"/*-*/,"r");
+    f=fopen(path/*-*/,"r");
+
+    if (f == NULL) {
+      f=fopen("etw.cfg"/*-*/,"r");
+    }
 
     newpitches=CheckNewPitches();