aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-10-22 21:10:54 -0500
committerRob Landley <rob@landley.net>2019-10-22 21:10:54 -0500
commit9eb72d920925b6b3ad0036ee2af790f0107f10c9 (patch)
tree7b3ce2b120c004948baf574a73efc8d66d44fa41
parent289f7c50cfdd390a6c4979f5e115e0f064538115 (diff)
downloadtoybox-9eb72d920925b6b3ad0036ee2af790f0107f10c9.tar.gz
JakeSFR on github pointed out that broken symlink relative detection was being
checked relative to the current directory, not from where the symlink lives.
-rw-r--r--toys/posix/file.c2
1 files changed, 1 insertions, 1 deletions
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);