From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#21104: 25.0.50; relative paths are added to load-path without -nsl (bug#21104) Date: Tue, 8 Dec 2015 20:16:29 +0100 Message-ID: References: <83mvtmcau2.fsf@gnu.org> <9aoae1wx8m.fsf@fencepost.gnu.org> <83h9jtc4eo.fsf@gnu.org> <6z4mfsu8pf.fsf@fencepost.gnu.org> <83wpsoby4s.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d39e28d5419052667cf0b X-Trace: ger.gmane.org 1449602239 12513 80.91.229.3 (8 Dec 2015 19:17:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Dec 2015 19:17:19 +0000 (UTC) Cc: 21104@debbugs.gnu.org, Keith David Bershatsky , Andreas Schwab To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 08 20:17:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a6NlA-0005Lp-4K for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Dec 2015 20:17:12 +0100 Original-Received: from localhost ([::1]:33160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Nl9-0005Xs-Hk for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Dec 2015 14:17:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Nl4-0005V5-K4 for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 14:17:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6Nl0-00079N-HA for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 14:17:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Nl0-00079G-Dw for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 14:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a6Nl0-0004cm-2s for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 14:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Dec 2015 19:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21104 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21104-submit@debbugs.gnu.org id=B21104.144960219217736 (code B ref 21104); Tue, 08 Dec 2015 19:17:02 +0000 Original-Received: (at 21104) by debbugs.gnu.org; 8 Dec 2015 19:16:32 +0000 Original-Received: from localhost ([127.0.0.1]:43685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a6NkW-0004bz-54 for submit@debbugs.gnu.org; Tue, 08 Dec 2015 14:16:32 -0500 Original-Received: from mail-vk0-f47.google.com ([209.85.213.47]:33858) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a6NkT-0004br-Md for 21104@debbugs.gnu.org; Tue, 08 Dec 2015 14:16:30 -0500 Original-Received: by vkbs1 with SMTP id s1so25679316vkb.1 for <21104@debbugs.gnu.org>; Tue, 08 Dec 2015 11:16:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5+/dGK/QqOeC2yEBAshzfrvKtYrzUgfekjKZTczBXY4=; b=VVXUyZnlYdgREtPNLThH4IF5S2t+YvtMuCfEB1QpkUfz5+7ACEOwnDjaaEWvCvHB0J KNREL7k7lGRIvf8RU3hY++4zppYKJ7v2Df5z1jVqU/A3zlOmB3VKiHiQeqFkuyRsFDsr TNgyaayov+Zrc94I16cEluofG+6dhEKR9AZXtfC9Ebwg7sB+i9MDZdqNQLiLafOiQOe4 /pyrQ0RqPWDAHDb7Ilbp57FemUKJHYH6tSzxot1b7ixrRzDCmOHv/Y5Adth2B/b3G1CJ oZR5YKHJ2JT05ARre2JgTgGly75eQvMpHsReBTHE4ERQmdJz1VAYd9W7b220zzuIhui8 zViQ== X-Received: by 10.31.152.207 with SMTP id a198mr1171348vke.68.1449602189184; Tue, 08 Dec 2015 11:16:29 -0800 (PST) Original-Received: by 10.31.210.133 with HTTP; Tue, 8 Dec 2015 11:16:29 -0800 (PST) In-Reply-To: <83wpsoby4s.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:109792 Archived-At: --001a113d39e28d5419052667cf0b Content-Type: text/plain; charset=UTF-8 Hi! I tries both solutions. Passing "1" as the last argument to `decode_env_path' doesn't work. When inspecting the code, it looks like it runs at least one iteration in the loop (see the `while (1)'), so the return value is either `(".")' or `(nil)', which is not what we want. > But like Andreas, my guess would be that "." and nil are equivalent here. > > Maybe you could just special-case it so that PATH_SITELOADSEARCH empty > > acts like no_site_lisp is set? > > Yes, that would also work. Anders, can you try that? > Yes, this works. However, I think it's a better solution to correct `decode_env_path' so that it returns nil when the string is empty and the `empty' parameter is 1. Also, I haven't investigated the cases where there is nothing between path separators, as in "foo::bar" (or when the string starts or ends with a separator). Today, it looks like it returns either `("foo" "." "bar)' or `("foo" nil "bar")' -- although I haven't verified this. A better solution would be to simply return `("foo" "bar")' -- path separators without anything in between are often simply a user mistake, we don't want to pollute system variables like `load-path' because of them. I would suggest that we rewrite the loop so that it ignores empty parts of the string (at the start, between two separators, and at the end). After the loop, if `lpath' is nil and `empty' is 0, add a single "." to `lpath'. -- Anders --001a113d39e28d5419052667cf0b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi!=C2=A0

I tries both solutions. Passing &qu= ot;1" as the last argument to `decode_env_path' doesn't work. = When inspecting the code, it looks like it runs at least one iteration in t= he loop (see the `while (1)'), so the return value is either `(".&= quot;)' or `(nil)', which is not what we want.

=
> But like Andreas, my guess would = be that "." and nil are equivalent here.
> Maybe you could just special-case it so that PATH_SITELOADSEARCH empty=
> acts like no_site_lisp is set?

Yes, that would also work.=C2=A0 Anders, can you try that?

Yes, this works.


However, I think it's a better solution to= correct `decode_env_path' so that it returns nil when the string is em= pty and the `empty' parameter is 1.
Also, I haven't investigated the case= s where there is nothing between path separators, as in "foo::bar"= ; (or when the string starts or ends with a separator). Today, it looks lik= e it returns either `("foo" "." "bar)' or `(&q= uot;foo" nil "bar")' -- although I haven't verified = this. A better solution would be to simply return `("foo" "b= ar")' -- path separators without anything in between are often sim= ply a user mistake, we don't want to pollute system variables like `loa= d-path' because of them.

I would suggest that we rewrite the loop so that it = ignores empty parts of the string (at the start, between two separators, an= d at the end). After the loop, if `lpath' is nil and `empty' is 0, = add a single "." to `lpath'.
=
=C2=A0 =C2=A0 -- Anders

--001a113d39e28d5419052667cf0b--