From 6c437186c0f30d18d739648146399990501a823d Mon Sep 17 00:00:00 2001
From: Rob Landley <rob@landley.net>
Date: Sat, 5 Jan 2008 15:20:26 -0600
Subject: Teach readlink to actually do -f.

---
 toys/readlink.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'toys')

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);
-- 
cgit v1.2.3