changeset 65412:3a9693f993b2

(smc_save_yourself_CB): Use get_current_dir_name.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 10 Sep 2005 11:30:55 +0000
parents 29cca0143d6f
children 8c8f2ad8b58f
files src/xsmfns.c
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/xsmfns.c	Sat Sep 10 11:30:06 2005 +0000
+++ b/src/xsmfns.c	Sat Sep 10 11:30:55 2005 +0000
@@ -52,10 +52,7 @@
 #include "termopts.h"
 #include "xterm.h"
 
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 1024
-#endif /* not MAXPATHLEN */
-
+extern char * get_current_dir_name ();
 
 /* The user login name.  */
 
@@ -205,7 +202,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 +256,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 +275,9 @@
 
   xfree (smid_opt);
 
+  if (cwd)
+    free (cwd);
+
   /* See if we maybe shall interact with the user.  */
   if (interactStyle != SmInteractStyleAny
       || ! shutdown