dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fwd: Bug#974900: dash removes trailing slash from script arguments
@ 2020-11-16 10:30 Andrej Shadura
  2020-11-17  3:32 ` Herbert Xu
  0 siblings, 1 reply; 11+ messages in thread
From: Andrej Shadura @ 2020-11-16 10:30 UTC (permalink / raw)
  To: dash; +Cc: Jeff King


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-12-12 21:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 10:30 Fwd: Bug#974900: dash removes trailing slash from script arguments Andrej Shadura
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

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).