52 |
#include "termopts.h" |
#include "termopts.h" |
53 |
#include "xterm.h" |
#include "xterm.h" |
54 |
|
|
55 |
#ifndef MAXPATHLEN |
extern char * get_current_dir_name (); |
|
#define MAXPATHLEN 1024 |
|
|
#endif /* not MAXPATHLEN */ |
|
|
|
|
56 |
|
|
57 |
/* The user login name. */ |
/* The user login name. */ |
58 |
|
|
202 |
int val_idx = 0; |
int val_idx = 0; |
203 |
int props_idx = 0; |
int props_idx = 0; |
204 |
|
|
205 |
char cwd[MAXPATHLEN+1]; |
char *cwd = NULL; |
206 |
char *smid_opt; |
char *smid_opt; |
207 |
|
|
208 |
/* How to start a new instance of Emacs. */ |
/* How to start a new instance of Emacs. */ |
256 |
props[props_idx]->vals[0].value = SDATA (Vuser_login_name); |
props[props_idx]->vals[0].value = SDATA (Vuser_login_name); |
257 |
++props_idx; |
++props_idx; |
258 |
|
|
259 |
/* The current directory property, not mandatory. */ |
cwd = get_current_dir_name (); |
260 |
#ifdef HAVE_GETCWD |
|
261 |
if (getcwd (cwd, MAXPATHLEN+1) != 0) |
if (cwd) |
|
#else |
|
|
if (getwd (cwd) != 0) |
|
|
#endif |
|
262 |
{ |
{ |
263 |
props[props_idx] = &prop_ptr[props_idx]; |
props[props_idx] = &prop_ptr[props_idx]; |
264 |
props[props_idx]->name = SmCurrentDirectory; |
props[props_idx]->name = SmCurrentDirectory; |
275 |
|
|
276 |
xfree (smid_opt); |
xfree (smid_opt); |
277 |
|
|
278 |
|
if (cwd) |
279 |
|
free (cwd); |
280 |
|
|
281 |
/* See if we maybe shall interact with the user. */ |
/* See if we maybe shall interact with the user. */ |
282 |
if (interactStyle != SmInteractStyleAny |
if (interactStyle != SmInteractStyleAny |
283 |
|| ! shutdown |
|| ! shutdown |