From 9eb72d920925b6b3ad0036ee2af790f0107f10c9 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 22 Oct 2019 21:10:54 -0500 Subject: JakeSFR on github pointed out that broken symlink relative detection was being checked relative to the current directory, not from where the symlink lives. --- toys/posix/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys') diff --git a/toys/posix/file.c b/toys/posix/file.c index 5f18a539..063397ce 100644 --- a/toys/posix/file.c +++ b/toys/posix/file.c @@ -476,7 +476,7 @@ void file_main(void) char *lnk = xreadlink(name); sprintf(what = toybuf, "%ssymbolic link to %s", - stat(lnk, &sb) ? "broken " : "", lnk); + stat(name, &sb) ? "broken " : "", lnk); free(lnk); } xputs(what); -- cgit v1.2.3