aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2004-10-19 19:09:37 +0000
committerJason Rumney2004-10-19 19:09:37 +0000
commit950090be0679d07beafa4eeb5d65b8e92be08a36 (patch)
tree0761516192458b3c30b189e6aa701be1f67ab86e /src
parent8550b998e80fbd6adf76671deed2e176d826ccf9 (diff)
downloademacs-950090be0679d07beafa4eeb5d65b8e92be08a36.tar.gz
emacs-950090be0679d07beafa4eeb5d65b8e92be08a36.zip
(init_environment): Set emacs_dir correctly when running
emacs from the build directory.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/w32.c26
2 files changed, 31 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5b22d072cf7..750e3d52df3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12004-10-19 Jason Rumney <jasonr@gnu.org>
2
3 * w32.c (init_environment): Set emacs_dir correctly when running
4 emacs from the build directory.
5
12004-10-19 Richard M. Stallman <rms@gnu.org> 62004-10-19 Richard M. Stallman <rms@gnu.org>
2 7
3 * editfns.c (Fdelete_and_extract_region): 8 * editfns.c (Fdelete_and_extract_region):
diff --git a/src/w32.c b/src/w32.c
index 12d1f21b091..7b54924d736 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1005,6 +1005,32 @@ init_environment (char ** argv)
1005 _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname); 1005 _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname);
1006 _putenv (strdup (buf)); 1006 _putenv (strdup (buf));
1007 } 1007 }
1008 /* Handle running emacs from the build directory: src/oo-spd/i386/ */
1009
1010 /* FIXME: should use substring of get_emacs_configuration ().
1011 But I don't think the Windows build supports alpha, mips etc
1012 anymore, so have taken the easy option for now. */
1013 else if (p && stricmp (p, "\\i386") == 0)
1014 {
1015 *p = 0;
1016 p = strrchr (modname, '\\');
1017 if (p != NULL)
1018 {
1019 *p = 0;
1020 p = strrchr (modname, '\\');
1021 if (p && stricmp (p, "\\src") == 0)
1022 {
1023 char buf[SET_ENV_BUF_SIZE];
1024
1025 *p = 0;
1026 for (p = modname; *p; p++)
1027 if (*p == '\\') *p = '/';
1028
1029 _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname);
1030 _putenv (strdup (buf));
1031 }
1032 }
1033 }
1008 } 1034 }
1009 1035
1010 for (i = 0; i < (sizeof (env_vars) / sizeof (env_vars[0])); i++) 1036 for (i = 0; i < (sizeof (env_vars) / sizeof (env_vars[0])); i++)