Use "unix" as hostname if hostname is empty.
authorPeng Huang <shawn.p.huang@gmail.com>
Mon, 30 Mar 2009 06:13:30 +0000 (14:13 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Mon, 30 Mar 2009 06:13:30 +0000 (14:13 +0800)
ibus/common.py
src/ibusshare.c

index 9b4c22b..527d3a5 100644 (file)
@@ -49,6 +49,8 @@ import sys
 
 __display = os.environ["DISPLAY"]
 __hostname, __display_screen = __display.split(":", 1)
+if not __hostname.strip():
+    __hostname = "unix"
 __display_number = __display_screen.split(".")[0]
 
 __username = None
index 510b2be..f87bb0c 100644 (file)
@@ -97,6 +97,9 @@ ibus_get_socket_path (void)
 
         username = ibus_get_user_name ();
 
+        if (hostname[0] == '\0')
+            hostname = "unix";
+
         path = g_strdup_printf (
             "/tmp/ibus-%s/ibus-%s-%s",
             username, hostname, displaynumber);