View | Details | Raw Unified | Return to bug 112920
Collapse All | Expand All

(-)src/bin/realpath/realpath.c (-6 / +19 lines)
Lines 44-56 Link Here
44
{
44
{
45
	char buf[PATH_MAX];
45
	char buf[PATH_MAX];
46
	char *p;
46
	char *p;
47
	int ch;
47
48
48
	if (argc == 2) {
49
	while ((ch = getopt(argc, argv, "")) != -1)
49
		if ((p = realpath(argv[1], buf)) == NULL)
50
		switch(ch) {
50
			err(1, "%s", buf);
51
		case '?':
51
	} else
52
		default:
53
			usage();
54
		}
55
	argc -= optind;
56
	argv += optind;
57
58
	if (argc < 1)
52
		usage();
59
		usage();
53
	(void)printf("%s\n", p);
60
61
	do {
62
		if ((p = realpath(*argv, buf)) == NULL)
63
			err(1, "%s", *argv);
64
		else
65
			(void)printf("%s\n", p);
66
	} while (*++argv != NULL);
54
	exit(0);
67
	exit(0);
55
}
68
}
56
69
Lines 58-63 Link Here
58
usage(void)
71
usage(void)
59
{
72
{
60
73
61
	(void)fprintf(stderr, "usage: realpath path\n");
74
	(void)fprintf(stderr, "usage: realpath path [...]\n");
62
  	exit(1);
75
  	exit(1);
63
}
76
}
(-)src/bin/realpath/realpath.1 (+1 lines)
Lines 42-47 Link Here
42
.Sh SYNOPSIS
42
.Sh SYNOPSIS
43
.Nm
43
.Nm
44
.Ar path
44
.Ar path
45
.Op Ar ...
45
.Sh DESCRIPTION
46
.Sh DESCRIPTION
46
The
47
The
47
.Nm
48
.Nm

Return to bug 112920