diff src/dispnew.c @ 14125:2f222e8b06f5

(init_display): Treat null string DISPLAY var like not set.
author Karl Heuer <kwzh@gnu.org>
date Tue, 09 Jan 1996 23:38:07 +0000
parents a3c83dde295e
children ee40177f6c68
line wrap: on
line diff
--- a/src/dispnew.c	Tue Jan 09 23:37:50 1996 +0000
+++ b/src/dispnew.c	Tue Jan 09 23:38:07 1996 +0000
@@ -2472,17 +2472,20 @@
      terminal is so dumb that emacs gives up before and doesn't bother
      using the window system.
 
-     If the DISPLAY environment variable is set, try to use X, and die
-     with an error message if that doesn't work.  */
+     If the DISPLAY environment variable is set and nonempty,
+     try to use X, and die with an error message if that doesn't work.  */
 
 #ifdef HAVE_X_WINDOWS
   if (! display_arg)
     {
+      char *display;
 #ifdef VMS
-      display_arg = (getenv ("DECW$DISPLAY") != 0);
+      display = getenv ("DECW$DISPLAY");
 #else
-      display_arg = (getenv ("DISPLAY") != 0);
+      display = getenv ("DISPLAY");
 #endif
+
+      display_arg = (display != 0 && *display != 0);
     }
 
   if (!inhibit_window_system && display_arg)