[SCM] Packaging for quakespasm branch, master, updated. upstream/0.85.4-15-g71856ad

David Banks amoebae at gmail.com
Tue Jun 28 12:44:47 UTC 2011


The following commit has been merged in the master branch:
commit 71856ad727ccb2fe3ce40c966b31b430642a886f
Author: David Banks <amoebae at gmail.com>
Date:   Tue Jun 28 13:44:29 2011 +0100

    add patch: history-in-dotfile.patch

diff --git a/debian/patches/history-in-dotfile.patch b/debian/patches/history-in-dotfile.patch
new file mode 100644
index 0000000..b22aecf
--- /dev/null
+++ b/debian/patches/history-in-dotfile.patch
@@ -0,0 +1,75 @@
+Description: Write the history file to a dotdir
+ The upstream attempted to write a history.txt file into the current directory.
+ This change moved the file to the hidden subdirectory of the user's home
+ directory.  It was fixed in a better way upstream in r444, but this depends
+ on a global change, so I stick with my patch until the next upstream release.
+ This patch should be removed on the release of >=0.85.5.
+Bug: http://sourceforge.net/tracker/?func=detail&aid=3289583&group_id=304914&atid=1285038
+From: David Banks <amoebae at gmail.com>
+--- a/Quake/keys.c
++++ b/Quake/keys.c
+@@ -27,7 +27,6 @@
+ 
+ */
+ 
+-#define		HISTORY_FILE_NAME "history.txt"
+ #define		CMDLINES 32
+ 
+ char		key_lines[CMDLINES][MAXCMDLINE];
+@@ -54,6 +53,9 @@
+ 
+ qboolean	repeatkeys[256]; //johnfitz -- if true, autorepeat is enabled for this key
+ 
++char *history_file_path;
++const char *history_file_suffix = "/.quakespasm/history.txt";
++
+ typedef struct
+ {
+ 	const char	*name;
+@@ -679,6 +681,19 @@
+ {
+ 	int i, c;
+ 	FILE *hf;
++        char *homedir;
++        size_t path_size;
++
++        // form the full path to the history file
++        homedir = getenv("HOME");
++        path_size = Q_strlen(homedir) + Q_strlen(history_file_suffix) + 1;
++        history_file_path = (char *) Z_Malloc(path_size);
++
++        Q_strcpy(history_file_path, homedir);
++        Q_strcat(history_file_path, history_file_suffix);
++
++        // create directory and all parents
++	COM_CreatePath(history_file_path);
+ 
+ 	for (i = 0; i < CMDLINES; i++)
+ 	{
+@@ -688,7 +703,7 @@
+ 	key_linepos = 1;
+ 
+ //	if (cl_savehistory.value)
+-	if ((hf = fopen(HISTORY_FILE_NAME, "rt")) != NULL)
++	if ((hf = fopen(history_file_path, "rt")) != NULL)
+ 	{
+ 		do
+ 		{
+@@ -715,7 +730,7 @@
+ 	FILE *hf;
+ 
+ //	if (cl_savehistory.value)
+-	if ((hf = fopen(HISTORY_FILE_NAME, "wt")) != NULL)
++	if ((hf = fopen(history_file_path, "wt")) != NULL)
+ 	{
+ 		i = edit_line;
+ 		do
+@@ -730,6 +745,8 @@
+ 		}
+ 		fclose(hf);
+ 	}
++
++        Z_Free(history_file_path);
+ }
+ 
+ /*
diff --git a/debian/patches/series b/debian/patches/series
index bd20771..fb17a31 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 remove-redundant-linking.patch
 support-user-directories.patch
+history-in-dotfile.patch

-- 
Packaging for quakespasm



More information about the Pkg-games-commits mailing list