aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toys/dirname.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/toys/dirname.c b/toys/dirname.c
index 454a5d67..b33836b6 100644
--- a/toys/dirname.c
+++ b/toys/dirname.c
@@ -1,8 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/* dirname.c - print directory portion of path, or "." if none.
+ *
+ * See http://www.opengroup.org/onlinepubs/009695399/utilities/dirname.html
+ */
+
#include "toys.h"
#include <libgen.h>
int dirname_main(void)
{
- puts(dirname(toys.optargs[0]));
+ puts(dirname(*toys.optargs));
return 0;
}