Index: main/config.c =================================================================== --- main/config.c (revision 188049) +++ main/config.c (working copy) @@ -750,6 +750,14 @@ newer->next = cur->next; newer->object = cur->object || object; + + /* Preserve everything */ + newer->lineno = cur->lineno; + newer->blanklines = cur->blanklines; + newer->precomments = cur->precomments; cur->precomments = NULL; + newer->sameline = cur->sameline; cur->sameline = NULL; + newer->trailing = cur->trailing; cur->trailing = NULL; + if (prev) prev->next = newer; else @@ -1570,6 +1578,9 @@ the ;! header comments were not also deleted in the process */ if (lineno - precomment_lines - fi->lineno < 0) { /* insertions can mess up the line numbering and produce negative numbers that mess things up */ return; + } else if (lineno == 0) { + /* Line replacements also mess things up */ + return; } for (i=fi->lineno; i