source: MondoRescue/branches/3.3/mindi-busybox/coreutils/length.c.disabled@ 3621

Last change on this file since 3621 was 3621, checked in by Bruno Cornec, 7 years ago

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

File size: 719 bytes
Line 
1/* vi: set sw=4 ts=4: */
2/*
3 * Licensed under GPLv2, see file LICENSE in this source tree.
4 */
5
6/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */
7
8//usage:#define length_trivial_usage
9//usage: "STRING"
10//usage:#define length_full_usage "\n\n"
11//usage: "Print STRING's length"
12//usage:
13//usage:#define length_example_usage
14//usage: "$ length Hello\n"
15//usage: "5\n"
16
17#include "libbb.h"
18
19/* This is a NOFORK applet. Be very careful! */
20
21int length_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
22int length_main(int argc, char **argv)
23{
24 if ((argc != 2) || (**(++argv) == '-')) {
25 bb_show_usage();
26 }
27
28 printf("%u\n", (unsigned)strlen(*argv));
29
30 return fflush_all();
31}
Note: See TracBrowser for help on using the repository browser.