Index: trunk/src_plugins/export_bboard/bboard.c =================================================================== --- trunk/src_plugins/export_bboard/bboard.c (revision 21307) +++ trunk/src_plugins/export_bboard/bboard.c (revision 21308) @@ -169,7 +169,7 @@ static pcb_hid_attribute_t *bboard_get_export_options(int *n) { - if (PCB) + if ((PCB != NULL) && (bboard_options[HA_bboardfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &bboard_options[HA_bboardfile], ".png"); bboard_options[HA_bgcolor].default_val.str_value = pcb_strdup("#FFFFFF"); Index: trunk/src_plugins/export_bom/bom.c =================================================================== --- trunk/src_plugins/export_bom/bom.c (revision 21307) +++ trunk/src_plugins/export_bom/bom.c (revision 21308) @@ -66,7 +66,7 @@ static pcb_hid_attribute_t *bom_get_export_options(int *n) { - if (PCB) + if ((PCB != NULL) && (bom_options[HA_bomfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &bom_options[HA_bomfile], ".bom"); if (n) Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 21307) +++ trunk/src_plugins/export_dsn/dsn.c (revision 21308) @@ -108,9 +108,8 @@ static pcb_hid_attribute_t *dsn_get_export_options(int *n) { - if (PCB) { + if ((PCB != NULL) && (dsn_options[HA_dsnfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &dsn_options[HA_dsnfile], ".dsn"); - } if (n) *n = NUM_OPTIONS; return dsn_options; Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 21307) +++ trunk/src_plugins/export_dxf/dxf.c (revision 21308) @@ -205,7 +205,7 @@ { const char *suffix = ".dxf"; - if (PCB) + if ((PCB != NULL) && (dxf_attribute_list[HA_dxffile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &dxf_attribute_list[HA_dxffile], suffix); if (n) Index: trunk/src_plugins/export_fidocadj/fidocadj.c =================================================================== --- trunk/src_plugins/export_fidocadj/fidocadj.c (revision 21307) +++ trunk/src_plugins/export_fidocadj/fidocadj.c (revision 21308) @@ -89,7 +89,7 @@ { const char *suffix = ".fcd"; - if (PCB) + if ((PCB != NULL) && (fidocadj_attribute_list[HA_fidocadjfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &fidocadj_attribute_list[HA_fidocadjfile], suffix); if (n) Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 21307) +++ trunk/src_plugins/export_gcode/gcode.c (revision 21308) @@ -247,9 +247,8 @@ last_unit_value = gcode_attribute_list[HA_unit].default_val.int_value; } - if (PCB) { + if ((PCB != NULL) && (gcode_attribute_list[HA_basename].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &gcode_attribute_list[HA_basename], ".gcode"); - } if (n) { *n = NUM_OPTIONS; } Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 21307) +++ trunk/src_plugins/export_gerber/gerber.c (revision 21308) @@ -365,7 +365,7 @@ static pcb_hid_attribute_t *gerber_get_export_options(int *n) { - if (PCB) + if ((PCB != NULL) && (gerber_options[HA_gerberfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &gerber_options[HA_gerberfile], ""); if (n) Index: trunk/src_plugins/export_ipcd356/ipcd356.c =================================================================== --- trunk/src_plugins/export_ipcd356/ipcd356.c (revision 21307) +++ trunk/src_plugins/export_ipcd356/ipcd356.c (revision 21308) @@ -414,7 +414,7 @@ static pcb_hid_attribute_t *ipcd356_get_export_options(int *n) { - if (PCB != NULL) + if ((PCB != NULL) && (ipcd356_options[HA_ipcd356_filename].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &ipcd356_options[HA_ipcd356_filename], ".net"); if (n != NULL) Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 21307) +++ trunk/src_plugins/export_openems/export_openems.c (revision 21308) @@ -168,7 +168,7 @@ const char *suffix = ".m"; pcb_mesh_t *mesh = pcb_mesg_get(MESH_NAME); - if (PCB) + if ((PCB != NULL) && (openems_attribute_list[HA_openemsfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &openems_attribute_list[HA_openemsfile], suffix); if (mesh != NULL) { Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 21307) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 21308) @@ -132,7 +132,7 @@ { const char *suffix = ".scad"; - if (PCB) + if ((PCB != NULL) && (openscad_attribute_list[HA_openscadfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &openscad_attribute_list[HA_openscadfile], suffix); if (n) Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 21307) +++ trunk/src_plugins/export_png/png.c (revision 21308) @@ -490,7 +490,7 @@ { const char *suffix = get_file_suffix(); - if (PCB) + if ((PCB != NULL) && (png_attribute_list[HA_pngfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &png_attribute_list[HA_pngfile], suffix); if (n) Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 21307) +++ trunk/src_plugins/export_ps/eps.c (revision 21308) @@ -148,7 +148,7 @@ static pcb_hid_attribute_t *eps_get_export_options(int *n) { - if (PCB) + if ((PCB != NULL) && (eps_attribute_list[HA_psfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &eps_attribute_list[HA_psfile], ".eps"); if (n) Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 21307) +++ trunk/src_plugins/export_ps/ps.c (revision 21308) @@ -438,7 +438,7 @@ static pcb_hid_attribute_t *ps_get_export_options(int *n) { - if (PCB) + if ((PCB != NULL) && (ps_attribute_list[HA_psfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &ps_attribute_list[HA_psfile], ".ps"); if (n) Index: trunk/src_plugins/export_stat/stat.c =================================================================== --- trunk/src_plugins/export_stat/stat.c (revision 21307) +++ trunk/src_plugins/export_stat/stat.c (revision 21308) @@ -113,7 +113,7 @@ { const char *suffix = ".stat.lht"; - if (PCB) + if ((PCB != NULL) && (stat_attribute_list[HA_statfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &stat_attribute_list[HA_statfile], suffix); if (n) Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 21307) +++ trunk/src_plugins/export_svg/svg.c (revision 21308) @@ -199,7 +199,7 @@ { const char *suffix = ".svg"; - if (PCB) + if ((PCB != NULL) && (svg_attribute_list[HA_svgfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &svg_attribute_list[HA_svgfile], suffix); if (n) Index: trunk/src_plugins/export_test/export_test.c =================================================================== --- trunk/src_plugins/export_test/export_test.c (revision 21307) +++ trunk/src_plugins/export_test/export_test.c (revision 21308) @@ -43,9 +43,8 @@ static pcb_hid_attribute_t *export_test_get_export_options(int *n) { - if (PCB) { + if ((PCB != NULL) && (export_test_options[HA_export_testfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &export_test_options[HA_export_testfile], ".export_test"); - } if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 21307) +++ trunk/src_plugins/export_xy/xy.c (revision 21308) @@ -141,7 +141,7 @@ xy_options[HA_unit].default_val.int_value = get_unit_struct("mil")->index; last_unit_value = xy_options[HA_unit].default_val.int_value; } - if (PCB) + if ((PCB != NULL) && (xy_options[HA_xyfile].default_val.str_value == NULL)) pcb_derive_default_filename(PCB->Filename, &xy_options[HA_xyfile], ".xy"); if (n)