[asterisk-commits] tilghman: trunk r148329 - /trunk/pbx/pbx_config.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Oct 10 13:59:58 CDT 2008
Author: tilghman
Date: Fri Oct 10 13:59:58 2008
New Revision: 148329
URL: http://svn.digium.com/view/asterisk?view=rev&rev=148329
Log:
Reset continuation items at the beginning of each context (suggested by
kpfleming).
Modified:
trunk/pbx/pbx_config.c
Modified: trunk/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_config.c?view=diff&rev=148329&r1=148328&r2=148329
==============================================================================
--- trunk/pbx/pbx_config.c (original)
+++ trunk/pbx/pbx_config.c Fri Oct 10 13:59:58 2008
@@ -1410,7 +1410,7 @@
const char *aft;
const char *newpm, *ovsw;
struct ast_flags config_flags = { 0 };
- char lastextension[256] = "";
+ char lastextension[256];
cfg = ast_config_load(config_file, config_flags);
if (!cfg)
return 0;
@@ -1451,11 +1451,19 @@
if (con == NULL)
continue;
+ /* Reset continuation items at the beginning of each context */
+ lastextension[0] = '\0';
+ lastpri = -2;
+
for (v = ast_variable_browse(cfg, cxt); v; v = v->next) {
char *tc = NULL;
char realext[256] = "";
char *stringp, *ext;
if (!strncasecmp(v->name, "same", 4)) {
+ if (ast_strlen_zero(lastextension)) {
+ ast_log(LOG_ERROR, "No previous pattern in the first entry of context '%s' to match '%s'!\n", cxt, v->name);
+ continue;
+ }
if ((stringp = tc = ast_strdup(v->value))) {
ast_copy_string(realext, lastextension, sizeof(realext));
goto copy_last_extension;
More information about the asterisk-commits
mailing list