Skip to content

Commit

Permalink
Improve null terminated lists handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Jan 12, 2018
1 parent 03e9f39 commit 8b98d23
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ namespace Sass {

// load plugins and register custom behaviors
for(auto plug : plugin_paths) { plugins.load_plugins(plug); }
for(auto fn : plugins.get_headers()) { c_headers.push_back(fn); }
for(auto fn : plugins.get_importers()) { c_importers.push_back(fn); }
for(auto fn : plugins.get_functions()) { c_functions.push_back(fn); }
const std::vector<Sass_Importer_Entry> headers = plugins.get_headers();
const std::vector<Sass_Importer_Entry> importers = plugins.get_importers();
const std::vector<Sass_Function_Entry> functions = plugins.get_functions();
for(Sass_Importer_Entry fn : headers) { c_headers.push_back(fn); }
for(Sass_Importer_Entry fn : importers) { c_importers.push_back(fn); }
for(Sass_Function_Entry fn : functions) { c_functions.push_back(fn); }

// sort the items by priority (lowest first)
sort (c_headers.begin(), c_headers.end(), sort_importers);
Expand Down

0 comments on commit 8b98d23

Please sign in to comment.