Bugfix: use last extension only for macro type determination

This commit is contained in:
Matthias Koefferlein 2022-05-29 20:06:04 +02:00
parent baa92d4455
commit 7748433669
2 changed files with 2 additions and 2 deletions

View File

@ -309,7 +309,7 @@ void Macro::load ()
bool
Macro::format_from_suffix (const std::string &fn, Macro::Interpreter &interpreter, std::string &dsl_name, bool &autorun_pref, Macro::Format &format)
{
return format_from_suffix_string (tl::extension (fn), interpreter, dsl_name, autorun_pref, format);
return format_from_suffix_string (tl::extension_last (fn), interpreter, dsl_name, autorun_pref, format);
}
std::pair<bool, std::string>

View File

@ -417,7 +417,7 @@ void MacroCollection::scan ()
std::vector<std::string> files = tl::dir_entries (p, true /*with_files*/, false /*with_dirs*/, true /*without_dotfiles*/);
for (auto f = files.begin (); f != files.end (); ++f) {
if (suffixes.find (tl::extension (*f)) != suffixes.end ()) {
if (suffixes.find (tl::extension_last (*f)) != suffixes.end ()) {
create_entry (tl::combine_path (p, *f));
}
}