Index: src/conf_core.h =================================================================== --- src/conf_core.h (revision 21040) +++ src/conf_core.h (revision 21041) @@ -99,6 +99,7 @@ CFT_STRING library_shell; CFT_LIST library_search_paths; CFT_STRING menu_file; /* where to load the default menu file from. If empty/unset, fall back to the legacy 'per hid ow menu file' setup. If contains slash, take it as a full path, if no slash, do a normal menu search for pcb-menu-NAME.lht */ + CFT_BOOLEAN export_basename; /* if an exported file contains the source file name, remove path from it, keeping the basename only */ CFT_STRING emergency_name; /* file name template for emergency save anonymous .pcb files (when pcb-rnd crashes); optional field: %ld --> pid; must be shorter than 240 characters. Don't do emergency save if this item is empty. */ CFT_STRING emergency_format; /* if set, use this format for the backups; if unset, use the default format */ Index: src/hid_init.c =================================================================== --- src/hid_init.c (revision 21040) +++ src/hid_init.c (revision 21041) @@ -247,3 +247,15 @@ { return pcb_hid_list; } + +const char *pcb_hid_export_fn(const char *filename) +{ + if (conf_core.rc.export_basename) { + const char *outfn = strrchr(filename, PCB_DIR_SEPARATOR_C); + if (outfn == NULL) + return filename; + return outfn + 1; + } + else + return filename; +} Index: src/hid_init.h =================================================================== --- src/hid_init.h (revision 21040) +++ src/hid_init.h (revision 21041) @@ -55,5 +55,9 @@ extern pcb_plugin_dir_t *pcb_plugin_dir_first, *pcb_plugin_dir_last; +/* Safe file name for inclusion in export file comments/headers; if the + user requested in the config, this becomes the basename of filename, + else it is the full file name */ +const char *pcb_hid_export_fn(const char *filename); #endif Index: src/pcb-conf.lht =================================================================== --- src/pcb-conf.lht (revision 21040) +++ src/pcb-conf.lht (revision 21041) @@ -73,6 +73,7 @@ # file_command = {} # file_path = {} library_shell = {} + export_basename = 0 emergency_name = {PCB.%ld.save} emergency_format = {lihata}