zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: "zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: Re: P modify in history event
Date: Tue, 19 Nov 2019 18:21:01 +0000	[thread overview]
Message-ID: <1574187661.6021.15.camel@samsung.com> (raw)
In-Reply-To: <d64df0bd-0ebb-4f5b-af63-cab62dfbd5fb@www.fastmail.com>

On Tue, 2019-11-19 at 18:00 +0000, Daniel Shahaf wrote:
> Can «zgetcwd()» return an empty string?  If that's possible, the
> condition will be undefined behaviour («""[-1]»).

Not in a sane world, but there are cases where we can't work out the
current directory.  I think we return "." then, in fact.  But a bit of
safety probably wouldn't hurt --- applying [-1] to functions arguably
isn't top class style.

pws

  reply	other threads:[~2019-11-19 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20191117184333epcas5p15bc1aa7b0f78182c3d1acc703f55d445@epcas5p1.samsung.com>
2019-11-17 18:42 ` Perry Smith
2019-11-18  9:47   ` Peter Stephenson
2019-11-19 18:00     ` Daniel Shahaf
2019-11-19 18:21       ` Peter Stephenson [this message]
2019-11-19 19:03         ` Daniel Shahaf

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=1574187661.6021.15.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --cc=zsh-users@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).