# HG changeset patch # User Rob Landley # Date 1182140148 14400 # Node ID 0dfead29c893639041f4dbe0c10fe655f2dfee37 # Parent 0a90a5fbc1bfdf5d1f10b2584d63b8862b634213 Add readlink. Why doesn't mercurial show newly added files in "hg diff"? diff -r 0a90a5fbc1bf -r 0dfead29c893 toys/readlink.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toys/readlink.c Mon Jun 18 00:15:48 2007 -0400 @@ -0,0 +1,20 @@ +/* vi: set sw=4 ts=4: */ +/* + * readlink.c - Return string representation of a symbolic link. + */ +// Note: Hardware in LINK_MAX as 127 since it was removed from glibc. + +#include "toys.h" + +int readlink_main(void) +{ + char *s = xreadlink(*toys.optargs); + + if (s) { + xputs(s); + if (CFG_TOYBOX_FREE) free(s); + return 0; + } + + return 1; +}