From 81963e23e2688f28ef0acbdbf72d831be097bd62 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Mon, 30 Mar 2009 14:13:30 +0800 Subject: Use "unix" as hostname if hostname is empty. --- ibus/common.py | 2 ++ src/ibusshare.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ibus/common.py b/ibus/common.py index 9b4c22b..527d3a5 100644 --- a/ibus/common.py +++ b/ibus/common.py @@ -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 diff --git a/src/ibusshare.c b/src/ibusshare.c index 510b2be..f87bb0c 100644 --- a/src/ibusshare.c +++ b/src/ibusshare.c @@ -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); -- cgit