Index: emacs/src/xsmfns.c diff -c emacs/src/xsmfns.c:1.15 emacs/src/xsmfns.c:1.16 *** emacs/src/xsmfns.c:1.15 Sun Aug 7 12:33:19 2005 --- emacs/src/xsmfns.c Sat Sep 10 11:30:55 2005 *************** *** 52,61 **** #include "termopts.h" #include "xterm.h" ! #ifndef MAXPATHLEN ! #define MAXPATHLEN 1024 ! #endif /* not MAXPATHLEN */ ! /* The user login name. */ --- 52,58 ---- #include "termopts.h" #include "xterm.h" ! extern char * get_current_dir_name (); /* The user login name. */ *************** *** 205,211 **** int val_idx = 0; int props_idx = 0; ! char cwd[MAXPATHLEN+1]; char *smid_opt; /* How to start a new instance of Emacs. */ --- 202,208 ---- int val_idx = 0; int props_idx = 0; ! char *cwd = NULL; char *smid_opt; /* How to start a new instance of Emacs. */ *************** *** 259,270 **** 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 { props[props_idx] = &prop_ptr[props_idx]; props[props_idx]->name = SmCurrentDirectory; --- 256,264 ---- props[props_idx]->vals[0].value = SDATA (Vuser_login_name); ++props_idx; ! cwd = get_current_dir_name (); ! ! if (cwd) { props[props_idx] = &prop_ptr[props_idx]; props[props_idx]->name = SmCurrentDirectory; *************** *** 280,285 **** --- 274,282 ---- SmcSetProperties (smcConn, props_idx, props); xfree (smid_opt); + + if (cwd) + free (cwd); /* See if we maybe shall interact with the user. */ if (interactStyle != SmInteractStyleAny
_______________________________________________ Emacs-diffs mailing list Emacs-diffs@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-diffs