aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2008-01-05 15:20:26 -0600
committerRob Landley <rob@landley.net>2008-01-05 15:20:26 -0600
commit6c437186c0f30d18d739648146399990501a823d (patch)
tree18eff6a2070f386a589340dac567bf6a5e4fc931
parent3e19db76440b81b3894a636309d01732e64e0d10 (diff)
downloadtoybox-6c437186c0f30d18d739648146399990501a823d.tar.gz
Teach readlink to actually do -f.
-rw-r--r--toys/readlink.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/toys/readlink.c b/toys/readlink.c
index c602f78e..79fdea52 100644
--- a/toys/readlink.c
+++ b/toys/readlink.c
@@ -9,7 +9,12 @@
void readlink_main(void)
{
- char *s = xreadlink(*toys.optargs);
+ char *s;
+
+ // Calculating full cannonical path?
+
+ if (CFG_READLINK_F && toys.optflags) s = realpath(*toys.optargs, NULL);
+ else s = xreadlink(*toys.optargs);
if (s) {
xputs(s);