[Asterisk-cvs] asterisk devicestate.c,1.9,1.10

russell russell
Wed Oct 26 11:41:45 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv16787

Modified Files:
	devicestate.c 
Log Message:
look for the last '-' in the channel name instead of the first (issue #5514)


Index: devicestate.c
===================================================================
RCS file: /usr/cvsroot/asterisk/devicestate.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- devicestate.c	24 Oct 2005 20:12:04 -0000	1.9
+++ devicestate.c	26 Oct 2005 15:34:34 -0000	1.10
@@ -195,12 +195,13 @@
 
 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));
 




More information about the svn-commits mailing list