From: Luigi Rizzo Date: Tue, 14 Nov 2006 16:31:57 +0000 (+0000) Subject: remove duplicated implementation for a deprecated function, use the X-Git-Tag: 1.6.0-beta1~3^2~3984 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfd44484128be42ed3212946597aa78d3ae5b89a;p=thirdparty%2Fasterisk.git remove duplicated implementation for a deprecated function, use the original one instead with appropriate changes in argc/argv. This is not always applicable, but in some simple cases it is. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47614 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/cli.c b/main/cli.c index 72db886d38..61331a8759 100644 --- a/main/cli.c +++ b/main/cli.c @@ -127,19 +127,9 @@ static char group_show_channels_help[] = " Optional regular expression pattern is matched to group names for each\n" " channel.\n"; -static int handle_load_deprecated(int fd, int argc, char *argv[]) -{ - if (argc != 2) - return RESULT_SHOWUSAGE; - if (ast_load_resource(argv[1])) { - ast_cli(fd, "Unable to load module %s\n", argv[1]); - return RESULT_FAILURE; - } - return RESULT_SUCCESS; -} - static int handle_load(int fd, int argc, char *argv[]) { + /* "module load " */ if (argc != 3) return RESULT_SHOWUSAGE; if (ast_load_resource(argv[2])) { @@ -149,6 +139,12 @@ static int handle_load(int fd, int argc, char *argv[]) return RESULT_SUCCESS; } +static int handle_load_deprecated(int fd, int argc, char *argv[]) +{ + /* I know it is nasty, but they do look very similar, and we never access argv[0] */ + return handle_load(fd, argc+1, argv - 1); +} + static int handle_reload_deprecated(int fd, int argc, char *argv[]) { int x;