From e992bae6f9adf3718c6263a36c004ead1c7272a8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 28 Nov 2009 15:18:53 +0100 Subject: *: remove a few more cases of argc usage. -89 bytes. Signed-off-by: Denys Vlasenko --- libbb/Kbuild | 1 + libbb/single_argv.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 libbb/single_argv.c (limited to 'libbb') diff --git a/libbb/Kbuild b/libbb/Kbuild index d9d5ad7..130ad25 100644 --- a/libbb/Kbuild +++ b/libbb/Kbuild @@ -92,6 +92,7 @@ lib-y += setup_environment.o lib-y += sha1.o lib-y += signals.o lib-y += simplify_path.o +lib-y += single_argv.o lib-y += skip_whitespace.o lib-y += speed_table.o lib-y += str_tolower.o diff --git a/libbb/single_argv.c b/libbb/single_argv.c new file mode 100644 index 0000000..6173c88 --- /dev/null +++ b/libbb/single_argv.c @@ -0,0 +1,16 @@ +/* vi: set sw=4 ts=4: */ +/* + * Utility routines. + * + * Copyright (C) 2009 Denys Vlasenko + * + * Licensed under GPLv2, see file LICENSE in this tarball for details. + */ +#include "libbb.h" + +char* FAST_FUNC single_argv(char **argv) +{ + if (!argv[1] || argv[2]) + bb_show_usage(); + return argv[1]; +} -- cgit v1.1