summarylogtreecommitdiffstats
path: root/gmrun-0.9.2-xdg.patch
diff options
context:
space:
mode:
authorBrian Bidulock2015-06-10 04:22:25 -0600
committerBrian Bidulock2015-06-10 04:22:25 -0600
commit969be4cc3501b769f3aeb7f5ba1f0b70c8da1d21 (patch)
tree2c178e3e9ec50f5d1fe515e00de6c299a3f87056 /gmrun-0.9.2-xdg.patch
downloadaur-969be4cc3501b769f3aeb7f5ba1f0b70c8da1d21.tar.gz
initial version
Diffstat (limited to 'gmrun-0.9.2-xdg.patch')
-rw-r--r--gmrun-0.9.2-xdg.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/gmrun-0.9.2-xdg.patch b/gmrun-0.9.2-xdg.patch
new file mode 100644
index 000000000000..c4a3c9778f91
--- /dev/null
+++ b/gmrun-0.9.2-xdg.patch
@@ -0,0 +1,58 @@
+diff -ur gmrun-0.9.2/src/history.cc gmrun-0.9.2-xdg/src/history.cc
+--- gmrun-0.9.2/src/history.cc 2002-08-17 15:19:31.000000000 +0200
++++ gmrun-0.9.2-xdg/src/history.cc 2012-06-04 23:42:35.314653414 +0200
+@@ -24,8 +24,15 @@
+ HistoryFile::HistoryFile()
+ {
+ m_file_entries = 0;
+- m_filename = g_get_home_dir();
+- m_filename += "/.gmrun_history";
++ const char* filename = getenv("XDG_CACHE_HOME");
++ if (filename != 0 && *filename != '\0') {
++ m_filename = filename;
++ m_filename += "/gmrun_history";
++ }
++ else {
++ m_filename = g_get_home_dir();
++ m_filename += "/.gmrun_history";
++ }
+ m_current = 0;
+ m_default_set = false;
+ read_the_file();
+diff -ur gmrun-0.9.2/src/prefs.cc gmrun-0.9.2-xdg/src/prefs.cc
+--- gmrun-0.9.2/src/prefs.cc 2012-06-04 22:35:00.671949439 +0200
++++ gmrun-0.9.2-xdg/src/prefs.cc 2012-06-04 23:24:24.184445962 +0200
+@@ -35,12 +35,29 @@
+ file_name += GMRUNRC;
+ init(file_name);
+
+- file_name = getenv("HOME");
+- if (!file_name.empty()) {
++ file_name.clear();
++ const char* filename = getenv("XDG_CONFIG_HOME");
++ if (filename != 0 && *filename != '\0') {
++ file_name = filename;
+ string::iterator i = file_name.end() - 1;
+- if (*i == '/') file_name.erase(i);
+- file_name += "/.";
++ if (*i != '/') {
++ file_name += '/';
++ }
+ file_name += GMRUNRC;
++ }
++ else {
++ filename = getenv("HOME");
++ if (filename != 0 && *filename != '\0') {
++ file_name = filename;
++ string::iterator i = file_name.end() - 1;
++ if (*i != '/') {
++ file_name += '/';
++ }
++ file_name += '.';
++ file_name += GMRUNRC;
++ }
++ }
++ if (!file_name.empty()) {
+ init(file_name);
+ }
+ }