From: Peter Stephenson <p.stephenson@samsung.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: expr length "$val" returns the wrong length for values containing NULL (\\0)
Date: Thu, 10 Dec 2015 09:37:57 +0000 [thread overview]
Message-ID: <20151210093757.6e56f161@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <CAMf8R04-hJ38Ndfz0dLDpvW8vwEhYuEMooOA6kWctAgxmWL8kA@mail.gmail.com>
On Thu, 10 Dec 2015 15:30:03 +1030
D Gowers <finticemo@gmail.com> wrote:
> I am aware of the prevalence of NUL-terminated strings, since I've coded in
> C in the past, that's why I wrote 'considerable bother to fix it'.
> Nevertheless, for a purpose such as argument passing, size + data is
> clearly better (easier to secure and more flexible)
The main point here --- which doesn't seem to have been mentioned --- is
that expr isn't a shell builtin. Within the shell, we do indeed treat
NUL characters as normal chracters. As soon as you pass them outside,
you are stuck --- there's no mechanism nor even convention for passing
embedded NULLs which would require a rethink about the standard
library conventions. This is a problem, but not a shell problem.
So if you want to continue the argument, you'll need to find some
higher power mailing list.
pws
next prev parent reply other threads:[~2015-12-10 9:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 1:52 D Gowers
2015-12-10 3:56 ` Nikolay Aleksandrovich Pavlov (ZyX)
2015-12-10 4:18 ` D Gowers
2015-12-10 4:29 ` Nikolay Aleksandrovich Pavlov (ZyX)
2015-12-10 5:00 ` D Gowers
2015-12-10 9:37 ` Peter Stephenson [this message]
2015-12-10 17:47 ` Nikolay Aleksandrovich Pavlov (ZyX)
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=20151210093757.6e56f161@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).