Mercurial > hg > toybox
view toys/readlink.c @ 232:cd4d5630c978
Move some generated files into the "generated" subdirectory.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 10 Jan 2008 14:40:13 -0600 |
parents | 52a0c06b2dad |
children | d4176f3f3835 |
line wrap: on
line source
/* vi: set sw=4 ts=4: */ /* * readlink.c - Return string representation of a symbolic link. * * Not in SUSv3. */ #include "toys.h" void readlink_main(void) { 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); if (CFG_TOYBOX_FREE) free(s); } else toys.exitval = 1; }