[asterisk-dev] [Code Review] Pattern matching with the '-' char.

rmudgett reviewboard at asterisk.org
Mon Nov 26 19:11:40 CST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2201/
-----------------------------------------------------------

(Updated Nov. 26, 2012, 7:11 p.m.)


Review request for Asterisk Developers.


Changes
-------

Update comments found by mmichelson.


Summary
-------

The '-' char is supposed to be ignored by the dialplan pattern matching.  Unfortunately, it's treatment is not handled consistently throughout the extension matching code.

* Made the old exten matching code consistently ignore '-' chars.

* Made the old exten matching code consistently handle case in the matching.

* Made ignore empty character sets.

* Fixed ast_extension_cmp() to return -1, 0, or 1 as documented.  The only user of it in pbx_lua.c was testing for -1.  It was originally returning the strcmp() value for less than which is not always going to be -1.

* Fix character set sorting if the sets have the same number of characters and start with the same character.
Character set [0-9] now sorts before [02-9a] as originally intended.


This addresses bug ASTERISK-19205.
    https://issues.asterisk.org/jira/browse/ASTERISK-19205


Diffs (updated)
-----

  /branches/1.8/UPGRADE.txt 376620 
  /branches/1.8/main/pbx.c 376620 

Diff: https://reviewboard.asterisk.org/r/2201/diff


Testing
-------

The failing patterns in ASTERISK-19205 now pass except for the invalid test of goto(foo-,1) for exten "_foo.".


Thanks,

rmudgett

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121127/39d05b31/attachment.htm>


More information about the asterisk-dev mailing list