All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Anton Mitterer <calestyo@scientia.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: DASH Mailing List <dash@vger.kernel.org>
Subject: Re: [PATCH 0/8] Add multi-byte support
Date: Sun, 28 Apr 2024 03:19:34 +0200	[thread overview]
Message-ID: <e2d1d076a3a3d7f21bdb64b13cf9c4c3f4967bb2.camel@scientia.org> (raw)
In-Reply-To: <Zi2dIJQcNVwJgxuN@gondor.apana.org.au>

On Sun, 2024-04-28 at 08:49 +0800, Herbert Xu wrote:
> 
> Are you talking about a theoretical undefined condition, or an
> actual one?  Which shell doesn't deal with ${foo%.} correctly?

Well my main point for this mail was how dash does it (and not just
about '.').
I guess it simply resorts to fnmatch(3) so it will probably do whatever
the system's libc does?

But it's really not just about '.' (which is more or less a rather safe
case).
If someone assumes dash would always be LC_ALL=C, that any such
operation where e.g. a byte is used that is part of a multi-byte
character might, AFAIU, lead to unexpected results.
E.g. an fnmatch implementation may just decide to stop and give an
error at the first byte that's not a valid characters, right?

Also there were some locales like Big5, which had the weird property of
having multibyte chars that contain byte sequences that form other
valid chars (see [0]).
Not sure if I remember that correctly, but it might have been undefined
when stripping of the "shorter" character from that.
Which again, couldn't have happened so far in dash, as it simply was C
local only.


Harald van Dijk made some extensive tests back then, how different
shells behave.
I think the austrin-group-l mailing list archive is not publicly
available, but if you have an account it was in that mail:
https://collaboration.opengroup.org/operational/mailarch.php?soph=N&action=show&archive=austin-group-l&num=34339&limit=100&offset=0
which showed that shells do indeed behave differently (the tests
weren't for '.').


Cheers,
Chris.

[0] https://unix.stackexchange.com/questions/383217/shell-keep-trailing-newlines-n-in-command-substitution/383411#383411

  reply	other threads:[~2024-04-28  1:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27 11:03 [PATCH 0/8] Add multi-byte support Herbert Xu
2024-04-16 10:03 ` [PATCH 1/8] shell: Call setlocale Herbert Xu
2024-04-16 10:38 ` [PATCH 2/8] shell: Use strcoll instead of strcmp where applicable Herbert Xu
2024-04-16 23:13 ` [PATCH 3/8] expand: Count multi-byte characters for VSLENGTH Herbert Xu
2024-04-18  8:59 ` [PATCH 4/8] expand: Process multi-byte characters in subevalvar Herbert Xu
2024-04-20 13:46 ` [PATCH 5/8] expand: Process multi-byte characters in expmeta Herbert Xu
2024-04-23 11:17 ` [PATCH 6/8] expand: Support multi-byte characters during field splitting Herbert Xu
2024-04-27  8:15 ` [PATCH 7/8] input: Allow MB_LEN_MAX calls to pungetc Herbert Xu
2024-04-27  8:41 ` [PATCH 8/8] parser: Add support for multi-byte characters Herbert Xu
2024-04-27 21:31 ` [PATCH 0/8] Add multi-byte support Christoph Anton Mitterer
2024-04-28  0:49   ` Herbert Xu
2024-04-28  1:19     ` Christoph Anton Mitterer [this message]
2024-04-28  1:35       ` Lawrence Velázquez
2024-04-28  1:50         ` Christoph Anton Mitterer
2024-04-28  2:03       ` Christoph Anton Mitterer
2024-04-28 14:50     ` Harald van Dijk
2024-04-29 13: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:
  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=e2d1d076a3a3d7f21bdb64b13cf9c4c3f4967bb2.camel@scientia.org \
    --to=calestyo@scientia.org \
    --cc=dash@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    /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 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.