Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 5342) +++ trunk/src/plug_io.c (revision 5343) @@ -847,8 +847,10 @@ if (out->len == 0) return 0; - for(n = 0; n < out->len; n++) + for(n = 0; n < out->len; n++) { out->plug[n] = available[n].plug; + out->extension[n] = out->plug[n]->default_extension; + } if (do_digest) { for(n = 0; n < out->len; n++) @@ -855,6 +857,7 @@ out->digest[n] = pcb_strdup_printf("%s (%s)", out->plug[n]->default_fmt, out->plug[n]->description); out->digest[n] = NULL; } + return out->len; } Index: trunk/src/plug_io.h =================================================================== --- trunk/src/plug_io.h (revision 5342) +++ trunk/src/plug_io.h (revision 5343) @@ -84,6 +84,7 @@ const char *default_fmt; const char *description; + const char *default_extension; /* used to generate save-as filename */ int save_preference_prio; /* all available save plugins are sorted by this before presenting them to the user to choose one */ }; @@ -130,7 +131,8 @@ typedef struct { int len; const pcb_plug_io_t *plug[PCB_IO_MAX_FORMATS+1]; - char *digest[PCB_IO_MAX_FORMATS+1]; /* string that contains the format identifier and the description */ + char *digest[PCB_IO_MAX_FORMATS+1]; /* string that contains the format identifier and the description (strdup'd) */ + const char *extension[PCB_IO_MAX_FORMATS+1]; /* default file extension, with the leading . (not strdup'd) */ } pcb_io_formats_t; /* Search all io plugins to see if typ/wr is supported. Return an ordered