From: Denys Vlasenko <dvlasenk@redhat.com>
To: dash@vger.kernel.org
Subject: Re: Are there users of ash's "pathopts"? Do other shells have such a thing?
Date: Mon, 3 Apr 2023 11:35:48 +0200 [thread overview]
Message-ID: <d92f3379-6d24-e4a9-035b-e928c13760c6@redhat.com> (raw)
In-Reply-To: <aad32205-1e0a-fea6-0825-8eb45c6ae915@redhat.com>
On 4/1/23 20:46, Denys Vlasenko wrote:
> ash allows PATH to contain "%builtin" and "DIR%func"
> pseudo-directories.
>
> %builtin shows in what order builtins to be found
> relative to searching directories for external commands.
>
> DIR%func allows to have a directory of "auto-loadable" functions.
> (dash git tree seems to have an example of it as src/funcs/*).
On a related note, chkmail() used to iterate over MAILPATH
using padvance(), the function which detects "pathopts".
In commit a068bf7aa310e8d36ae11c2aec47af1446a18827
"exec: Stricter pathopt parsing"
padvance() was modified, and old behavior
is retained in the form padvance_magic(..., 2),
which treats any %text as pathopt (not only %builtin and %func).
chkmail() now uses padvance_magic(..., 2) call,
presumably as exact 1:1 equivalent of old code.
But it's not necessary, right? chkmail() does not actually uses
pathopts. It can just call padvance_magic(..., 0)
so as to ignore them.
If so, then code for padvance_magic(..., 2) is unused
and can be removed. Only "magic" values of 0 and 1 will be in use.
next prev parent reply other threads:[~2023-04-03 9:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-01 18:46 Are there users of ash's "pathopts"? Do other shells have such a thing? Denys Vlasenko
2023-04-01 19:13 ` Harald van Dijk
2023-04-01 20:49 ` Denys Vlasenko
2023-04-01 21:35 ` Lawrence Velázquez
2023-04-02 17:25 ` Sven Mascheck
2023-04-03 9:35 ` Denys Vlasenko [this message]
2023-04-03 11:35 ` Harald van Dijk
2023-04-03 11:54 ` Denys Vlasenko
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=d92f3379-6d24-e4a9-035b-e928c13760c6@redhat.com \
--to=dvlasenk@redhat.com \
--cc=dash@vger.kernel.org \
/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