aboutsummaryrefslogtreecommitdiff
path: root/toys/readlink.c
blob: c602f78e377ba66dde64ca348061d55e3f619555 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* 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 = xreadlink(*toys.optargs);

	if (s) {
		xputs(s);
		if (CFG_TOYBOX_FREE) free(s);
	} else toys.exitval = 1;
}