]> git.eshelyaron.com Git - emacs.git/commitdiff
(smc_save_yourself_CB): Use get_current_dir_name.
authorEli Zaretskii <eliz@gnu.org>
Sat, 10 Sep 2005 11:31:50 +0000 (11:31 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 10 Sep 2005 11:31:50 +0000 (11:31 +0000)
src/ChangeLog
src/xsmfns.c

index deb2b4ce3eb3cdd98b809520b1f60236059cc02b..fb1de530546d279a1b31e056e68da21af400ac2d 100644 (file)
@@ -1,3 +1,14 @@
+2005-09-10  Giuseppe Scrivano  <gscrivano@gmail.com>
+
+       Remove the MAXPATHLEN limitations:
+
+       * sysdep.c (get_current_dir_name) [!HAVE_CURRENT_DIR_NAME]: New
+       function.
+
+       * buffer.c (init_buffer): Use it.
+
+       * xsmfns.c (smc_save_yourself_CB): Ditto.
+
 2005-09-09  Kim F. Storm  <storm@cua.dk>
 
        * doc.c (Fsubstitute_command_keys): Lookup key binding for
index 4285dd767188415d10fc4986b9a120f1579f1984..4b99d7be61a287e62ad075f064c8f09e7f1ddc3b 100644 (file)
@@ -52,10 +52,7 @@ Boston, MA 02110-1301, USA.  */
 #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 @@ smc_save_yourself_CB (smcConn,
   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 @@ smc_save_yourself_CB (smcConn,
   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 @@ smc_save_yourself_CB (smcConn,
 
   xfree (smid_opt);
 
+  if (cwd)
+    free (cwd);
+
   /* See if we maybe shall interact with the user.  */
   if (interactStyle != SmInteractStyleAny
       || ! shutdown