Index: src/file.c =================================================================== --- src/file.c (revision 920) +++ src/file.c (revision 921) @@ -451,7 +451,7 @@ AttributePut (PCB, "PCB::grid::unit", Settings.grid_unit->suffix); sort_netlist (); - rats_patch_apply(PCB); + rats_patch_make_edited(PCB); set_some_route_style (); @@ -1482,7 +1482,7 @@ else fclose (fp); sort_netlist (); - rats_patch_apply(PCB); + rats_patch_make_edited(PCB); return (0); } Index: src/rats_patch.c =================================================================== --- src/rats_patch.c (revision 920) +++ src/rats_patch.c (revision 921) @@ -67,8 +67,17 @@ } } -void rats_patch_apply(PCBTypePtr pcb) +int rats_patch_apply(PCBTypePtr pcb, rats_patch_line_t *patch) { + return 0; +} + +void rats_patch_make_edited(PCBTypePtr pcb) +{ + rats_patch_line_t *n; + netlist_free(&(pcb->NetlistLib[NETLIST_EDITED])); netlist_copy(&(pcb->NetlistLib[NETLIST_EDITED]), &(pcb->NetlistLib[NETLIST_INPUT])); + for(n = pcb->NetlistPatches; n != NULL; n = n->next) + rats_patch_apply(pcb, n); } Index: src/rats_patch.h =================================================================== --- src/rats_patch.h (revision 920) +++ src/rats_patch.h (revision 921) @@ -2,4 +2,7 @@ void rats_patch_append(PCBTypePtr pcb, rats_patch_op_t op, const char *id, const char *a1, const char *a2); /* Create [NETLIST_EDITED] from [NETLIST_INPUT] applying the patch */ -void rats_patch_apply(PCBTypePtr pcb); +void rats_patch_make_edited(PCBTypePtr pcb); + +/* apply a single patch record on [NETLIST_EDITED]; returns non-zero on failure */ +int rats_patch_apply(PCBTypePtr pcb, rats_patch_line_t *patch);