zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: :P test failure
Date: Thu, 26 Mar 2020 22:21:20 +0000	[thread overview]
Message-ID: <20200326222120.4832e6ad@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <b8c58b13375dd10cc5c39a2fda20d51b090880c0.camel@ntlworld.com>

Peter Stephenson wrote on Thu, 26 Mar 2020 21:27 +0000:
> This doesn't work on my machine:
> 
>  # This is a bit brittle as it depends on PATH_MAX.
>  # We could use sysconf..
>  bad_pwd="/${(l:16000:: :):-}"
>  print ${bad_pwd:P} | wc -c
> 0:modifier ':P' with path too long
> >16002  
> 
> The modification fails with error and output
> 
> zsh: path expansion failed, using root directory
> 2

The behaviour you see is exactly what the test's _expected_ output was
before 45583/0004.  Is there any chance that you ran HEAD's tests on an
old zsh binary by accident?

What's the value of errno?  (Patch at the end for your convenience)

Cheers,

Daniel

diff --git a/Src/utils.c b/Src/utils.c
index 69885fed3..8a7558700 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1030,8 +1030,9 @@ xsymlink(char *s, int heap)
     if (*s != '/')
 	return NULL;
     *xbuf = '\0';
+    errno = 0;
     if (!chrealpath(&s, 'P', heap)) {
-	zwarn("path expansion failed, using root directory");
+	zwarn("path expansion failed (%e) using root directory", errno);
 	return heap ? dupstring("/") : ztrdup("/");
     }
     return s;

  reply	other threads:[~2020-03-26 22:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 21:27 Peter Stephenson
2020-03-26 22:21 ` Daniel Shahaf [this message]
2020-03-28 16:16   ` Peter Stephenson

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=20200326222120.4832e6ad@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=p.w.stephenson@ntlworld.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).