1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-30 16:00:53 +01:00

49297 (quoting amended): error message in files module.

If ENONENT it could be the other argument that doesn't exist, so check.
This commit is contained in:
Peter Stephenson 2021-08-24 19:21:53 +01:00
parent cd89e1937d
commit 4a9437317f
2 changed files with 12 additions and 1 deletions

View file

@ -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;
}