[asterisk-bugs] Manager inserts extra linefeeds in updateconfig action

Bruno Rodrigues bruno_agostinho at yahoo.com.br
Mon Oct 6 11:37:19 CDT 2008


When trying to use GUI-2.0 with Asterisk 1.6.0, I had trouble with the Manager inserting extra linefeeds on the configuration files. I had to introduce the following modification to the config.c file:

--- ../../config.c 2008-07-18 15:51:20.000000000 -0300
+++ config.c 2008-10-04 01:12:36.000000000 -0300
@@ -1525,6 +1525,10 @@
    stored in the precomments, but not printed back out.
    I did have to make sure that comments following
    the ;! header comments were not also deleted in the process */
+ if(!lineno) {
+ fi->lineno++;
+ return;
+ }
    for (i=fi->lineno;i<lineno - precomment_lines; i++) {
    fprintf(fp,"\n");
}
@@ -1623,8 +1627,8 @@
    if (cmtp)
    fprintf(f,"%s", cmtp);
    }
- if (!cat->precomments)
- fprintf(f,"\n");
+ /*if (!cat->precomments)
+ fprintf(f,"\n");*/
    fprintf(f, "[%s]", cat->name);
    if (cat->ignored || !AST_LIST_EMPTY(&cat->template_instances)) {
        fprintf(f, "(");
 
Now it's working fine. Hope this can help others. By the way, I use Fedora 9 on a x86_64 machine.
 
Regards,
 
Bruno


      Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-bugs/attachments/20081006/f6075fe3/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.patchfile
Type: application/octet-stream
Size: 735 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-bugs/attachments/20081006/f6075fe3/attachment.obj 


More information about the asterisk-bugs mailing list