Index: hid_cam.c =================================================================== --- hid_cam.c (revision 36770) +++ hid_cam.c (revision 36771) @@ -178,6 +178,15 @@ } } } + for(i = pcb_plug_io_chain; i != NULL; i = i->next) { + if (i->alternate_extension != NULL) { + int slen = strlen(i->alternate_extension); + if (bl > slen && strcmp(buf + bl - slen, i->alternate_extension) == 0) { + buf[bl - slen] = 0; + break; + } + } + } strcat(buf, suffix); } Index: plug_io.c =================================================================== --- plug_io.c (revision 36770) +++ plug_io.c (revision 36771) @@ -389,6 +389,15 @@ } } } + if (n->alternate_extension != NULL) { + int elen = strlen(n->alternate_extension); + if ((elen < fn_len) && (strcmp(end-elen, n->alternate_extension) == 0)) { + if (n->save_preference_prio > best_score) { + best_score = n->save_preference_prio; + best = n; + } + } + } } if (best != NULL) return best; Index: plug_io.h =================================================================== --- plug_io.h (revision 36770) +++ plug_io.h (revision 36771) @@ -140,6 +140,7 @@ const char *default_fmt; const char *description; const char *default_extension; /* used to generate save-as filename */ + const char *alternate_extension; /* old/alternative extension, used to generate save-as filename */ const char *fp_extension; /* used to generate save-as filename for footprints */ const char *mime_type;