comparison 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
comparison
equal deleted inserted replaced
90226:df78f2fb8f6a 90227:10fe5fadaf89
49 #include "sysselect.h" 49 #include "sysselect.h"
50 #include "lisp.h" 50 #include "lisp.h"
51 #include "termhooks.h" 51 #include "termhooks.h"
52 #include "termopts.h" 52 #include "termopts.h"
53 #include "xterm.h" 53 #include "xterm.h"
54
55 #ifndef MAXPATHLEN
56 #define MAXPATHLEN 1024
57 #endif /* not MAXPATHLEN */
58
59 54
60 /* The user login name. */ 55 /* The user login name. */
61 56
62 extern Lisp_Object Vuser_login_name; 57 extern Lisp_Object Vuser_login_name;
63 58
203 198
204 SmPropValue values[20]; 199 SmPropValue values[20];
205 int val_idx = 0; 200 int val_idx = 0;
206 int props_idx = 0; 201 int props_idx = 0;
207 202
208 char cwd[MAXPATHLEN+1]; 203 char *cwd = NULL;
209 char *smid_opt; 204 char *smid_opt;
210 205
211 /* How to start a new instance of Emacs. */ 206 /* How to start a new instance of Emacs. */
212 props[props_idx] = &prop_ptr[props_idx]; 207 props[props_idx] = &prop_ptr[props_idx];
213 props[props_idx]->name = SmCloneCommand; 208 props[props_idx]->name = SmCloneCommand;
257 props[props_idx]->vals = &values[val_idx++]; 252 props[props_idx]->vals = &values[val_idx++];
258 props[props_idx]->vals[0].length = strlen (SDATA (Vuser_login_name)); 253 props[props_idx]->vals[0].length = strlen (SDATA (Vuser_login_name));
259 props[props_idx]->vals[0].value = SDATA (Vuser_login_name); 254 props[props_idx]->vals[0].value = SDATA (Vuser_login_name);
260 ++props_idx; 255 ++props_idx;
261 256
262 /* The current directory property, not mandatory. */ 257 cwd = get_current_dir_name ();
263 #ifdef HAVE_GETCWD 258
264 if (getcwd (cwd, MAXPATHLEN+1) != 0) 259 if (cwd)
265 #else
266 if (getwd (cwd) != 0)
267 #endif
268 { 260 {
269 props[props_idx] = &prop_ptr[props_idx]; 261 props[props_idx] = &prop_ptr[props_idx];
270 props[props_idx]->name = SmCurrentDirectory; 262 props[props_idx]->name = SmCurrentDirectory;
271 props[props_idx]->type = SmARRAY8; 263 props[props_idx]->type = SmARRAY8;
272 props[props_idx]->num_vals = 1; 264 props[props_idx]->num_vals = 1;
278 270
279 271
280 SmcSetProperties (smcConn, props_idx, props); 272 SmcSetProperties (smcConn, props_idx, props);
281 273
282 xfree (smid_opt); 274 xfree (smid_opt);
275
276 if (cwd)
277 free (cwd);
283 278
284 /* See if we maybe shall interact with the user. */ 279 /* See if we maybe shall interact with the user. */
285 if (interactStyle != SmInteractStyleAny 280 if (interactStyle != SmInteractStyleAny
286 || ! shutdown 281 || ! shutdown
287 || saveType == SmSaveLocal 282 || saveType == SmSaveLocal