extern Lisp_Object Vsystem_configuration;
void
-init_environment ()
+init_environment (char ** argv)
{
int len;
static const char * const tempdirs[] = {
{
char *p;
- char modname[MAX_PATH];
+ static char modname[MAX_PATH];
if (!GetModuleFileName (NULL, modname, MAX_PATH))
abort ();
*p = 0;
SetCurrentDirectory (modname);
+
+ /* Ensure argv[0] has the full path to Emacs. */
+ *p = '\\';
+ argv[0] = modname;
}
init_user_info ();