diff options
author | Peng Huang <shawn.p.huang@gmail.com> | 2009-03-30 14:13:30 +0800 |
---|---|---|
committer | Peng Huang <shawn.p.huang@gmail.com> | 2009-03-30 14:13:30 +0800 |
commit | 81963e23e2688f28ef0acbdbf72d831be097bd62 (patch) | |
tree | 3af3c2d9d05ded9f5b0db944439c423370937be3 | |
parent | 15e6b996bc63dcc6cf97802ce1905d2aa582144c (diff) | |
download | ibus-81963e23e2688f28ef0acbdbf72d831be097bd62.tar.gz ibus-81963e23e2688f28ef0acbdbf72d831be097bd62.tar.xz ibus-81963e23e2688f28ef0acbdbf72d831be097bd62.zip |
Use "unix" as hostname if hostname is empty.
-rw-r--r-- | ibus/common.py | 2 | ||||
-rw-r--r-- | src/ibusshare.c | 3 |
2 files changed, 5 insertions, 0 deletions
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); |