Subject: Re: bug#21104: 25.0.50; relative paths are added to load-path without -nsl (bug#21104)

From: Eli Zaretskii <[email-masked]>
Date: Tue, 08 Dec 2015 18:05:03 +0200

> From: Glenn Morris <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  Keith David Bershatsky <[email-masked]>,  [email-masked]
> Date: Mon, 07 Dec 2015 20:22:01 -0500
> 
> Anders Lindgren wrote:
> 
> > #define PATH_SITELOADSEARCH ""
> >
> > I think this cause "." to be added to the load path in "init_lread" (I can
> > verify this tomorrow).
> 
> Sounds like unintended fallout from b9d8edcf6dbe; ie the cure for the
> minor issue of #19850 is worse than the disease.

Does the patch below solve the problem?

(Does anyone know why we call decode_env_path with last argument zero
in this case?  I don't see how that could make any sense here.)

diff --git a/src/lread.c b/src/lread.c
index 0da5819..c70a7b0 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4356,7 +4356,7 @@ init_lread (void)
           if (!no_site_lisp)
             {
               Lisp_Object sitelisp;
-              sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);
+              sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 1);
               if (! NILP (sitelisp))
                 default_lpath = nconc2 (sitelisp, default_lpath);
             }
@@ -4387,7 +4387,7 @@ init_lread (void)
       if (initialized && !no_site_lisp)
         {
           Lisp_Object sitelisp;
-          sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);
+          sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 1);
           if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path);
         }
     }