diff src/xsmfns.c @ 90227:10fe5fadaf89

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-81 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 532-541) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 112-115) - Update from CVS
author Miles Bader <miles@gnu.org>
date Sun, 11 Sep 2005 22:21:01 +0000
parents 2d92f5c9d6ae 8763a59d5982
children aa89c814f853
line wrap: on
line diff
--- a/src/xsmfns.c	Tue Sep 06 07:30:14 2005 +0000
+++ b/src/xsmfns.c	Sun Sep 11 22:21:01 2005 +0000
@@ -52,11 +52,6 @@
 #include "termopts.h"
 #include "xterm.h"
 
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 1024
-#endif /* not MAXPATHLEN */
-
-
 /* The user login name.  */
 
 extern Lisp_Object Vuser_login_name;
@@ -205,7 +200,7 @@
   int val_idx = 0;
   int props_idx = 0;
 
-  char cwd[MAXPATHLEN+1];
+  char *cwd = NULL;
   char *smid_opt;
 
   /* How to start a new instance of Emacs.  */
@@ -259,12 +254,9 @@
   props[props_idx]->vals[0].value = SDATA (Vuser_login_name);
   ++props_idx;
 
-  /* The current directory property, not mandatory.  */
-#ifdef HAVE_GETCWD
-  if (getcwd (cwd, MAXPATHLEN+1) != 0)
-#else
-  if (getwd (cwd) != 0)
-#endif
+  cwd = get_current_dir_name ();
+
+  if (cwd)
     {
       props[props_idx] = &prop_ptr[props_idx];
       props[props_idx]->name = SmCurrentDirectory;
@@ -281,6 +273,9 @@
 
   xfree (smid_opt);
 
+  if (cwd)
+    free (cwd);
+
   /* See if we maybe shall interact with the user.  */
   if (interactStyle != SmInteractStyleAny
       || ! shutdown