From: Russell Bryant Date: Wed, 26 Oct 2005 15:34:34 +0000 (+0000) Subject: look for the last '-' in the channel name instead of the first (issue #5514) X-Git-Tag: 1.2.0-beta2~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f622612bee04030c15ee3e4257ce4f2a1ca16106;p=thirdparty%2Fasterisk.git look for the last '-' in the channel name instead of the first (issue #5514) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6854 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/devicestate.c b/devicestate.c index fabed739d5..086cadbf42 100755 --- a/devicestate.c +++ b/devicestate.c @@ -195,12 +195,13 @@ static void do_state_change(const char *device) static int __ast_device_state_changed_literal(char *buf) { - char *device; - char *parse; + char *device, *tmp; struct state_change *change = NULL; - parse = buf; - device = strsep(&parse, "-"); + device = buf; + tmp = strrchr(device, '-'); + if (tmp) + *tmp = '\0'; if (change_thread != AST_PTHREADT_NULL) change = calloc(1, sizeof(*change) + strlen(device));