[asterisk-commits] tilghman: branch 1.6.0 r161183 - in /branches/1.6.0: ./ main/config.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 4 23:43:37 CST 2008


Author: tilghman
Date: Thu Dec  4 23:43:36 2008
New Revision: 161183

URL: http://svn.digium.com/view/asterisk?view=rev&rev=161183
Log:
Merged revisions 161181 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r161181 | tilghman | 2008-12-04 23:41:41 -0600 (Thu, 04 Dec 2008) | 11 lines
  
  The first file should have a blank config filename in the structure, so that
  when a save occurs to a different filename, everything goes to the alternate
  filename, instead of appending to the original.  This is important for the
  AMI command UpdateConfig.
  (closes issue #13301)
   Reported by: trevo
   Patches: 
         20081113__bug13301.diff.txt uploaded by Corydon76 (license 14)
         20081113__bug13301__1.6.0.diff.txt uploaded by Corydon76 (license 14)
   Tested by: Corydon76, blitzrage
........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/main/config.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/main/config.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/config.c?view=diff&rev=161183&r1=161182&r2=161183
==============================================================================
--- branches/1.6.0/main/config.c (original)
+++ branches/1.6.0/main/config.c Thu Dec  4 23:43:36 2008
@@ -951,7 +951,9 @@
  		if (*c++ != '(')
  			c = NULL;
 		catname = cur;
-		if (!(*cat = newcat = ast_category_new(catname, ast_strlen_zero(suggested_include_file)?configfile:suggested_include_file, lineno))) {
+		if (!(*cat = newcat = ast_category_new(catname,
+				S_OR(suggested_include_file, cfg->include_level == 1 ? "" : configfile),
+				lineno))) {
 			return -1;
 		}
 		(*cat)->lineno = lineno;
@@ -1070,7 +1072,7 @@
 				}
 				/* A #include */
 				/* record this inclusion */
-				inclu = ast_include_new(cfg, configfile, cur, !do_include, cur2, lineno, real_inclusion_name, sizeof(real_inclusion_name));
+				inclu = ast_include_new(cfg, cfg->include_level == 1 ? "" : configfile, cur, !do_include, cur2, lineno, real_inclusion_name, sizeof(real_inclusion_name));
 
 				do_include = ast_config_internal_load(cur, cfg, flags, real_inclusion_name, who_asked) ? 1 : 0;
 				if (!ast_strlen_zero(exec_file))
@@ -1099,7 +1101,7 @@
 				c++;
 			} else
 				object = 0;
-			if ((v = ast_variable_new(ast_strip(cur), ast_strip(c), *suggested_include_file ? suggested_include_file : configfile))) {
+			if ((v = ast_variable_new(ast_strip(cur), ast_strip(c), S_OR(suggested_include_file, cfg->include_level == 1 ? "" : configfile)))) {
 				v->lineno = lineno;
 				v->object = object;
 				*last_cat = 0;




More information about the asterisk-commits mailing list