diff --git a/changelog_entries/preprocess_non_cfg.md b/changelog_entries/preprocess_non_cfg.md new file mode 100644 index 00000000000..73ce00b2f49 --- /dev/null +++ b/changelog_entries/preprocess_non_cfg.md @@ -0,0 +1,2 @@ + ### Miscellaneous and Bug Fixes + * The command line `--preprocess` utility now accepts any filename, not just those ending .cfg. diff --git a/src/serialization/preprocessor.cpp b/src/serialization/preprocessor.cpp index c3d3ae8974b..253cdb9d269 100644 --- a/src/serialization/preprocessor.cpp +++ b/src/serialization/preprocessor.cpp @@ -1770,17 +1770,14 @@ void preprocess_resource(const std::string& res_name, // Files in current directory for(const std::string& file : files) { - preprocess_resource(file, defines_map, write_cfg, write_plain_cfg, parent_directory); + if(filesystem::ends_with(file, ".cfg")) { + preprocess_resource(file, defines_map, write_cfg, write_plain_cfg, parent_directory); + } } return; } - // process only config files. - if(!filesystem::ends_with(res_name, ".cfg")) { - return; - } - LOG_PREPROC << "processing resource: " << res_name; // disable filename encoding to get clear #line in cfg.plain