From: Eli Zaretskii <eliz@gnu.org>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: ofv@wanadoo.es, 24956@debbugs.gnu.org
Subject: bug#24956: 26.0.50; On Windows, setting PATH in compilation-environment has no effect
Date: Tue, 22 Nov 2016 18:01:32 +0200 [thread overview]
Message-ID: <8337ij8pwj.fsf@gnu.org> (raw)
In-Reply-To: <CAM-tV-9Lzuov4ZMf=q39oRNZDDGpjeHReCRiRu0NjEF3r9iOXw@mail.gmail.com> (message from Noam Postavsky on Mon, 21 Nov 2016 18:19:53 -0500)
> From: Noam Postavsky <npostavs@users.sourceforge.net>
> Date: Mon, 21 Nov 2016 18:19:53 -0500
> Cc: Óscar Fuentes <ofv@wanadoo.es>, 24956@debbugs.gnu.org
>
> On Sat, Nov 19, 2016 at 2:16 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > . I'd rather have the WINDOWSNT-specific code separate (on w32.c),
> > so perhaps the for-loop you modified could be left intact, and
> > instead we perform an additional pass over Vprocess_environment,
> > after it is already copied, to replace these two variables with
> > their upper-case equivalents, in that special code on w32.c.
>
> Okay, here is a patch that does that.
Thanks.
> + /* Make the same modification to `process-environment' which has
> + already been initialized in set_initial_environment. */
> + Lisp_Object env = Vprocess_environment;
> + Lisp_Object path = build_string ("PATH=");
> + Lisp_Object path_len = make_number (SBYTES (path));
> + Lisp_Object comspec = build_string ("COMSPEC=");
> + Lisp_Object comspec_len = make_number (SBYTES (comspec));
> + for (; CONSP (env); env = XCDR (env))
> + {
> + Lisp_Object entry = XCAR (env);
> + if (EQ (Fcompare_strings (entry, Qnil, path_len, path, Qnil, Qnil, Qt), Qt))
> + for (ptrdiff_t i = 0; i < SBYTES (path); i++)
> + SSET (entry, i, SREF (path, i));
> + else if (EQ (Fcompare_strings (entry, Qnil, comspec_len, comspec, Qnil, Qnil, Qt), Qt))
> + for (ptrdiff_t i = 0; i < SBYTES (comspec); i++)
> + SSET (entry, i, SREF (comspec, i));
> + }
Why not compare in using _strnicmp instead of Fcompare_strings? That
would save you the need to cons Lisp strings, and will be more
efficient (Fcompare_strings is quite complex). Not that speed matters
in this case, but it's just looks strange to me. Am I missing
something?
next prev parent reply other threads:[~2016-11-22 16:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-16 22:22 bug#24956: 26.0.50; On Windows, setting PATH in compilation-environment has no effect Óscar Fuentes
2016-11-17 17:59 ` Noam Postavsky
2016-11-17 20:59 ` Eli Zaretskii
2016-11-17 21:27 ` Noam Postavsky
2016-11-18 9:46 ` Eli Zaretskii
2016-11-18 22:11 ` Noam Postavsky
2016-11-19 7:16 ` Eli Zaretskii
2016-11-21 23:19 ` Noam Postavsky
2016-11-22 16:01 ` Eli Zaretskii [this message]
2016-11-22 22:35 ` Noam Postavsky
2016-11-23 16:07 ` Eli Zaretskii
2016-11-27 20:01 ` Óscar Fuentes
2016-11-27 20:13 ` npostavs
2016-11-28 22:53 ` Noam Postavsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8337ij8pwj.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=24956@debbugs.gnu.org \
--cc=npostavs@users.sourceforge.net \
--cc=ofv@wanadoo.es \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.