]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
A zero-length return from platform_get_x_display() (for instance, a
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Sat, 11 Feb 2006 18:00:23 +0000 (18:00 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Sat, 11 Feb 2006 18:00:23 +0000 (18:00 +0000)
zero-length DISPLAY variable in the environment) caused an assertion
failure when X11 forwarding was attempted. Fixed (now treated the same
as a NULL return, e.g., a non-existent DISPLAY variable).

[originally from svn r6549]

x11fwd.c

index 13c6823ec47fcd186acc613c2e78d728b5a2de4c..6e04abe1b77a245b11858ac297c4c97e757978a5 100644 (file)
--- a/x11fwd.c
+++ b/x11fwd.c
@@ -245,7 +245,7 @@ char *x11_display(const char *display) {
     char *ret;
     if(!display || !*display) {
        /* try to find platform-specific local display */
-       if((ret = platform_get_x_display())==0)
+       if((ret = platform_get_x_display())==0 || !*ret)
            /* plausible default for all platforms */
            ret = dupstr(":0");
     } else