--- gcin-1.6.4.pre7/chewing.cpp	2011-05-14 20:25:22.000000000 -0400
+++ gcin-1.6.4.pre7_cwlin/chewing.cpp	2011-05-16 06:10:08.000000000 -0400
@@ -7,9 +7,6 @@
 
 #include <chewing/chewing.h>
 
-// FIXME: change to use the correct DIRs
-#define DATADIR      "/usr/share/chewing"
-#define HASHDIR      "/tmp"
 #define MAX_SEG_NUM  128
 
 typedef struct _SEGMENT {
@@ -162,7 +159,23 @@
 static gboolean
 chewing_initialize (void)
 {
-    chewing_Init (DATADIR, HASHDIR);
+    char *pszChewingHashDir;
+    char *pszHome;
+
+    pszHome = getenv ("HOME");
+    if (!pszHome)
+        pszHome = "";
+
+    pszChewingHashDir = malloc (strlen (pszHome) + strlen ("/.chewing/") + 1);
+    memset (pszChewingHashDir, 0x00, strlen (pszHome) + strlen ("/.chewing/") + 1);
+    sprintf (pszChewingHashDir, "%s/.chewing", pszHome);
+
+    if (chewing_Init (CHEWING_DATADIR, pszChewingHashDir) != 0)
+    {
+        free (pszChewingHashDir);
+        return FALSE;
+    }
+    free (pszChewingHashDir);
 
     g_pChewingCtx = chewing_new ();
     if (!g_pChewingCtx)
