From: Juanma Barranquero Date: Wed, 7 Dec 2011 23:14:13 +0000 (+0100) Subject: src/w32.c: Implement --no-site-lisp on Windows (bug#10208). X-Git-Tag: emacs-pretest-24.0.93~211 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6e44397c4a000df50237a57ef089989e6c4bbc5e;p=emacs.git src/w32.c: Implement --no-site-lisp on Windows (bug#10208). --- diff --git a/src/ChangeLog b/src/ChangeLog index f8d290774fc..9ee5ccc1f5e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-12-07 Juanma Barranquero + + * w32.c (init_environment): If no_site_lisp, remove site-lisp + dirs from the default value of EMACSLOADPATH (bug#10208). + 2011-12-07 Glenn Morris * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in diff --git a/src/w32.c b/src/w32.c index 304445e2238..b26327462d8 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1654,6 +1654,24 @@ init_environment (char ** argv) } } + /* When Emacs is invoked with --no-site-lisp, we must remove the + site-lisp directories from the default value of EMACSLOADPATH. + This assumes that the site-lisp entries are at the front, and + that additional entries do exist. */ + if (no_site_lisp) + { + for (i = 0; i < N_ENV_VARS; i++) + { + if (strcmp (env_vars[i].name, "EMACSLOADPATH") == 0) + { + char *site; + while ((site = strstr (env_vars[i].def_value, "site-lisp"))) + env_vars[i].def_value = strchr (site, ';') + 1; + break; + } + } + } + #define SET_ENV_BUF_SIZE (4 * MAX_PATH) /* to cover EMACSLOADPATH */ /* Treat emacs_dir specially: set it unconditionally based on our