]> code.delx.au - gnu-emacs/commitdiff
(get_server_config) [WINDOWSNT]: Search the server file on APPDATA
authorJuanma Barranquero <lekktu@gmail.com>
Tue, 7 Nov 2006 11:23:12 +0000 (11:23 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Tue, 7 Nov 2006 11:23:12 +0000 (11:23 +0000)
if it doesn't exist on HOME, even if HOME is defined.

lib-src/ChangeLog
lib-src/emacsclient.c

index 9210fa6afba66a802f0d80cdaaf92cf0d63fa60c..c2319d6486b3509586c39dca90d752341d17dbc7 100644 (file)
@@ -1,5 +1,8 @@
 2006-11-07  Juanma Barranquero  <lekktu@gmail.com>
 
+       * emacsclient.c (get_server_config) [WINDOWSNT]: Look for the server
+       file on APPDATA if it doesn't exist on HOME, even if HOME is defined.
+
        * emacsclient.c (get_server_config): Extract also the Emacs pid
        from the server file.  On Windows, try to force the Emacs frame to
        the foreground.
index 76ed21b29f88a1772384fa8d51e1b8ba5b4aefb3..3c3b27374fcc219fe38f3cdf2857f1d6efa32d92 100644 (file)
@@ -449,16 +449,21 @@ get_server_config (server, authentication)
   else
     {
       char *home = getenv ("HOME");
-#ifdef WINDOWSNT
-      if (! home)
-          home = getenv ("APPDATA");
-#endif
+
       if (home)
         {
           char *path = alloca (32 + strlen (home) + strlen (server_file));
           sprintf (path, "%s/.emacs.d/server/%s", home, server_file);
           config = fopen (path, "rb");
         }
+#ifdef WINDOWSNT
+      if (!config && (home = getenv ("APPDATA")))
+        {
+          char *path = alloca (32 + strlen (home) + strlen (server_file));
+          sprintf (path, "%s/.emacs.d/server/%s", home, server_file);
+          config = fopen (path, "rb");
+        }
+#endif
     }
 
   if (! config)