public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Cygwin: spawn: Treat empty path as the current directory.
Date: Thu, 30 Jun 2022 21:16:35 -0400	[thread overview]
Message-ID: <376762b9-6ef2-4415-b3e6-fbc9be48f183@cornell.edu> (raw)
In-Reply-To: <c4a8d150-4d16-2af5-a7ac-26e42f9befb8@cornell.edu>

On 6/30/2022 11:45 AM, Ken Brown wrote:
> On 6/27/2022 8:44 AM, Takashi Yano wrote:
>> - With this patch, the empty path (empty element in PATH or PATH is
>>    absent) is treated as the current directory as Linux does.
>> Addresses: https://cygwin.com/pipermail/cygwin/2022-June/251730.html
> 
> It might be a good idea to include a comment in the code and the commit message 
> that this feature is being added for Linux compatibility but that it is 
> deprecated.  According to https://man7.org/linux/man-pages/man7/environ.7.html,
> 
>                As a legacy feature, a zero-length prefix (specified as
>                two adjacent colons, or an initial or terminating colon)
>                is interpreted to mean the current working directory.
>                However, use of this feature is deprecated, and POSIX
>                notes that a conforming application shall use an explicit
>                pathname (e.g., .)  to specify the current working
>                directory.
> 
> Alternatively, maybe this is a case where we should prefer POSIX compliance to 
> Linux compatibility.  Corinna, WDYT?

I withdraw my suggestion.  There's already a comment in the code saying, "An 
empty path or '.' means the current directory", so it's clear that the intention 
was to support that feature, and the code was simply buggy.

I've now read through the patch, and it looks good to me.  This was pretty 
tricky to get right.

Ken

  parent reply	other threads:[~2022-07-01  1:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 12:44 Takashi Yano
2022-06-30 15:45 ` Ken Brown
2022-06-30 18:35   ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-06-30 19:03     ` Brian Inglis
2022-06-30 19:04     ` Takashi Yano
2022-07-01  1:16   ` Ken Brown [this message]
2022-07-01 23:31     ` Takashi Yano
2022-07-02  1:32       ` Ken Brown
2022-07-04  8:37         ` Corinna Vinschen
2022-07-04 23:05           ` Ken Brown
2022-07-05  4:54             ` Takashi Yano

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=376762b9-6ef2-4415-b3e6-fbc9be48f183@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin-patches@cygwin.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).