diff options
author | Rob Landley <rob@landley.net> | 2020-03-02 11:32:09 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-03-02 11:32:09 -0600 |
commit | 4815b4f35f272ee3a4f8ac13adb5bd5dfc8ff4a6 (patch) | |
tree | a515c544fc6bd996dcf87ad7811ccb71f14c75f7 /toys/other/readlink.c | |
parent | 75ad10ea53073a2dc90808a36db2fcd5107909ce (diff) | |
download | toybox-4815b4f35f272ee3a4f8ac13adb5bd5dfc8ff4a6.tar.gz |
Merge realpath into readlink, use xabspath() instead of libc realpath().
Diffstat (limited to 'toys/other/readlink.c')
-rw-r--r-- | toys/other/readlink.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/toys/other/readlink.c b/toys/other/readlink.c index 9ebf68d7..bae09536 100644 --- a/toys/other/readlink.c +++ b/toys/other/readlink.c @@ -3,6 +3,7 @@ * Copyright 2007 Rob Landley <rob@landley.net> USE_READLINK(NEWTOY(readlink, "<1nqmef(canonicalize)[-mef]", TOYFLAG_USR|TOYFLAG_BIN)) +USE_REALPATH(NEWTOY(realpath, "<1", TOYFLAG_USR|TOYFLAG_BIN)) config READLINK bool "readlink" @@ -19,9 +20,18 @@ config READLINK -m Ignore missing entries, show where it would be -n No trailing newline -q Quiet (no output, just error code) + +config REALPATH + bool "realpath" + default y + help + usage: realpath FILE... + + Display the canonical absolute pathname */ #define FOR_readlink +#define FORCE_FLAGS #include "toys.h" void readlink_main(void) @@ -41,3 +51,9 @@ void readlink_main(void) } else toys.exitval = 1; } } + +void realpath_main(void) +{ + toys.optflags = FLAG_f; + readlink_main(); +} |