[asterisk-commits] dhubbard: trunk r215338 - in /trunk: ./ apps/app_softhangup.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 1 20:17:03 CDT 2009


Author: dhubbard
Date: Tue Sep  1 20:16:59 2009
New Revision: 215338

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=215338
Log:
Merged revisions 215270 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r215270 | dhubbard | 2009-09-01 18:04:52 -0500 (Tue, 01 Sep 2009) | 12 lines
  
  Use strrchr() so SoftHangup will correctly truncate multi-hyphen channel names
  
  In general channel names are in the form Foo/Bar-Z, but the channel name
  could have multiple hyphens and look like Foo/B-a-r-Z.  Use strrchr to
  truncate the channel name at the last hyphen.
  
  (closes issue #15810)
  Reported by: dhubbard
  Patches:
        dw-softhangup-1.4.patch uploaded by dhubbard (license 733)
........

Modified:
    trunk/   (props changed)
    trunk/apps/app_softhangup.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_softhangup.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_softhangup.c?view=diff&rev=215338&r1=215337&r2=215338
==============================================================================
--- trunk/apps/app_softhangup.c (original)
+++ trunk/apps/app_softhangup.c Tue Sep  1 20:16:59 2009
@@ -103,11 +103,13 @@
 		ast_copy_string(name, c->name, sizeof(name));
 		if (ast_test_flag(&flags, OPTION_ALL)) {
 			/* CAPI is set up like CAPI[foo/bar]/clcnt */ 
-			if (!strcmp(c->tech->type, "CAPI")) 
+			if (!strcmp(c->tech->type, "CAPI")) {
 				cut = strrchr(name, '/');
 			/* Basically everything else is Foo/Bar-Z */
-			else
-				cut = strchr(name, '-');
+			} else {
+				/* use strrchr() because Foo/Bar-Z could actually be Foo/B-a-r-Z */
+				cut = strrchr(name,'-');
+			}
 			/* Get rid of what we've cut */
 			if (cut)
 				*cut = 0;




More information about the asterisk-commits mailing list