diff options
author | anthony <anthony@fiord.com> | 2011-04-20 13:18:02 +0400 |
---|---|---|
committer | Bernhard R. Link <brlink@debian.org> | 2011-05-10 20:36:20 +0200 |
commit | 16196bce07d6ee1beb1bb83db0d36e841b7b59da (patch) | |
tree | f93fc16210819ff07d314b0b8b360f49004b9951 /src | |
parent | 7d1e839e1ad28053220a2f240a5981093b76aee7 (diff) | |
download | ratpoison-16196bce07d6ee1beb1bb83db0d36e841b7b59da.zip |
Fix display_string construction to handle new XDisplayString() behaviour
XDisplayString does not append ".screen number" to return value after
http://gitorious.org/omcfadde/libx11/commit/f92e754297ec5fdb81068b56a4435026666224fa
Fix by appending .screen_num to the end of s->display_string in such case
Diffstat (limited to 'src')
-rw-r--r-- | src/screen.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/screen.c b/src/screen.c index f26f036..ab8bf95 100644 --- a/src/screen.c +++ b/src/screen.c @@ -283,8 +283,13 @@ init_screen (rp_screen *s, int screen_num) char *dot; dot = strrchr(s->display_string, '.'); - if (dot && strlen (dot) < strlen (colon)) - sprintf(dot, ".%i", screen_num); + if (!dot || (strlen(dot) > strlen (colon)) ) + { + /* no dot was found or it belongs to fqdn - append screen_num + to the end */ + dot = s->display_string + strlen (s->display_string); + } + sprintf(dot, ".%i", screen_num); } PRINT_DEBUG (("display string: %s\n", s->display_string)); |