dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Andrej Shadura" <andrew@shadura.me>
To: dash@vger.kernel.org
Cc: "Jeff King" <peff@peff.net>
Subject: Fwd: Bug#974900: dash removes trailing slash from script arguments
Date: Mon, 16 Nov 2020 11:30:24 +0100	[thread overview]
Message-ID: <f957f8b9-3430-4752-9798-9c5417d9707a@www.fastmail.com> (raw)


this is another bug report I have received.

----- Original message -----
From: Jeff King <peff@peff.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Bug#974900: dash removes trailing slash from script arguments
Date: Monday, 16 November 2020 10:45

Package: dash
Version: 0.5.11+git20200708+dd9ef66-2
Severity: normal
Tags: upstream

With the latest version of dash, I get this behavior:

  $ touch here
  $ dash -c 'printf "%s\n" "$@"' -- here/ not-here/

The trailing slash is stripped from the argument "here/", when the file
"here" exists in the current directory (but not from "not-here/", which
does not exist).

This is rather surprising to scripts which may not even intend for their
arguments to be files (I noticed because it breaks Git's test suite,
which expects "some-script foo/" to preserve the trailing slash, which
is meaningful in its internal path matching). And certainly it differs
from the behavior of, which prints "here/".

Bisection points to upstream 7638476 (shell: Enable fnmatch/glob by
default, 2020-05-28). And indeed, building locally with "./configure
--disable-fnmatch" makes the problem go away. But since that commit was
only flipping the defaults, presumably the problem was already there.
Bisecting with "--enable-fnmatch --enable-glob" shows that it comes from
6900ff6 (expand: Fix glibc glob(3) support, 2018-03-26).

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.9.0-2-amd64 (SMP w/16 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dash depends on:
ii  debconf [debconf-2.0]  1.5.74
ii  debianutils            4.11.2
ii  dpkg                   1.20.5
ii  libc6                  2.31-4

dash recommends no packages.

dash suggests no packages.

-- debconf information:
* dash/sh: true

             reply	other threads:[~2020-11-16 11:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 10:30 Andrej Shadura [this message]
2020-11-17  3:32 ` Herbert Xu
2020-12-09 12:27   ` Aurelien Jarno
2020-12-10  2:56     ` Bug#976865: " Herbert Xu
2020-12-10  7:58       ` Aurelien Jarno
2020-12-10 11:35         ` Herbert Xu
2020-12-10 15:20           ` Jeff King
2020-12-11  2:03             ` Herbert Xu
2020-12-11  2:05               ` Jeff King
2020-12-12 21:18           ` Florian Weimer
2020-12-10 12:12     ` Herbert Xu

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f957f8b9-3430-4752-9798-9c5417d9707a@www.fastmail.com \
    --to=andrew@shadura.me \
    --cc=dash@vger.kernel.org \
    --cc=peff@peff.net \
    --subject='Re: Fwd: Bug#974900: dash removes trailing slash from script arguments' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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 NNTP newsgroup(s).