diff options
author | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2021-08-24 19:21:53 +0100 |
---|---|---|
committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2021-08-24 19:21:53 +0100 |
commit | 4a9437317fd374e983934d5b18c7d1d6ee041645 (patch) | |
tree | c4766c879ade6e8c20d9fab3bfa9fe00c515217f /Src/Modules/files.c | |
parent | cd89e1937daa9dcfa6b372ec56018904c0f34581 (diff) | |
download | zsh-4a9437317fd374e983934d5b18c7d1d6ee041645.tar.gz zsh-4a9437317fd374e983934d5b18c7d1d6ee041645.tar.xz zsh-4a9437317fd374e983934d5b18c7d1d6ee041645.zip |
49297 (quoting amended): error message in files module.
If ENONENT it could be the other argument that doesn't exist, so check.
Diffstat (limited to 'Src/Modules/files.c')
-rw-r--r-- | Src/Modules/files.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Src/Modules/files.c b/Src/Modules/files.c index a1d6f6bf2..d991f69d7 100644 --- a/Src/Modules/files.c +++ b/Src/Modules/files.c @@ -346,7 +346,13 @@ domove(char *nam, MoveFunc movefn, char *p, char *q, int flags) unlink(qbuf); } if(movefn(pbuf, qbuf)) { - zwarnnam(nam, "%s: %e", p, errno); + int ferrno = errno; + char *errfile = p; + if (ferrno == ENOENT && !lstat(pbuf, &st)) { + /* p *does* exist, so error is in q */ + errfile = q; + } + zwarnnam(nam, "`%s': %e", errfile, ferrno); zsfree(pbuf); return 1; } |