zsh-workers
 help / color / mirror / code / Atom feed
* :P test failure
@ 2020-03-26 21:27 Peter Stephenson
  2020-03-26 22:21 ` Daniel Shahaf
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2020-03-26 21:27 UTC (permalink / raw)
  To: Zsh hackers list

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

pws


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

* Re: :P test failure
  2020-03-26 21:27 :P test failure Peter Stephenson
@ 2020-03-26 22:21 ` Daniel Shahaf
  2020-03-28 16:16   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Shahaf @ 2020-03-26 22:21 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list

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;

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

* Re: :P test failure
  2020-03-26 22:21 ` Daniel Shahaf
@ 2020-03-28 16:16   ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2020-03-28 16:16 UTC (permalink / raw)
  To: Zsh hackers list

On Thu, 2020-03-26 at 22:21 +0000, Daniel Shahaf wrote:
> 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?

Yes, rebuilding does indeed fix it.  Somehow I managed to get it built
with my patch in but not yours --- probably the result of a merge.

Cheers
pws


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

end of thread, other threads:[~2020-03-28 16:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 21:27 :P test failure Peter Stephenson
2020-03-26 22:21 ` Daniel Shahaf
2020-03-28 16:16   ` Peter Stephenson

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