freebsd-ports/chinese/sunpinyin/files/patch-xdg
Wen Heping 6507fdb245 - Update to 2.0.4rc1
PR:		167863
Submitted by:	Zhihao Yuan <lichray@gmail.com>
2012-05-25 07:25:44 +00:00

37 lines
1.3 KiB
Text

--- src/ime-core/imi_options.cpp~ 2012-05-13 22:55:19.000000000 -0500
+++ src/ime-core/imi_options.cpp 2012-05-13 23:08:27.566965023 -0500
@@ -73,12 +73,15 @@ CSimplifiedChinesePolicy::loadResources(
if (!m_user_data_dir.size()) {
char path[256];
- const char *home = getenv("HOME");
- snprintf(path,
- sizeof(path),
- "%s/%s",
- home,
- SUNPINYIN_USERDATA_DIR_PREFIX);
+ const char *home = getenv("XDG_CONFIG_HOME");
+ if (home == NULL)
+ snprintf(path, sizeof(path),
+ "%s/.config/%s", getenv("HOME"),
+ SUNPINYIN_USERDATA_DIR_PREFIX);
+ else
+ snprintf(path, sizeof(path),
+ "%s/%s", home,
+ SUNPINYIN_USERDATA_DIR_PREFIX);
m_user_data_dir = path;
}
diff -uNr src/ime-core/imi_options.h src/ime-core/imi_options.h
--- src/ime-core/imi_options.h 2010-09-22 13:14:35.883000000 +0800
+++ src/ime-core/imi_options.h 2010-09-22 13:15:20.760000002 +0800
@@ -50,7 +50,7 @@
#include "pinyin/shuangpin_seg.h"
#ifndef SUNPINYIN_USERDATA_DIR_PREFIX
-#define SUNPINYIN_USERDATA_DIR_PREFIX ".sunpinyin"
+#define SUNPINYIN_USERDATA_DIR_PREFIX "sunpinyin"
#endif
struct CSimplifiedChinesePolicy : public IConfigurable