changeset 73809:cbc1f46b6590

(get_server_config) [WINDOWSNT]: Search the server file on APPDATA if it doesn't exist on HOME, even if HOME is defined.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 07 Nov 2006 11:20:32 +0000
parents 2889a065b1d4
children 46eea1cb4780
files lib-src/emacsclient.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/emacsclient.c	Tue Nov 07 10:58:19 2006 +0000
+++ b/lib-src/emacsclient.c	Tue Nov 07 11:20:32 2006 +0000
@@ -449,16 +449,21 @@
   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)