@@ -200,7 +200,7 @@ void check_file_types(const Files &files)
200200 auto fn = get_temp_filename ();
201201 std::ofstream o (fn, std::ios::binary | std::ios::out);
202202 if (!o)
203- throw std::runtime_error (" Cannot open file for writing: " + fn. u8string ( ));
203+ throw std::runtime_error (" Cannot open file for writing: " + to_printable_string (fn ));
204204 for (auto &file : files)
205205 o << " file -ib " << normalize_path (file) << " \n " ;
206206 o.close ();
@@ -367,7 +367,7 @@ void Patch::save(yaml &node) const
367367 save_replace (file_patches, " replace" , UNIDIFF_PREFIX);
368368}
369369
370- void Patch::patchSources (const Project &prj, const Files &files) const
370+ void Patch::patchSources (const Project &prj, const FilesSorted &files) const
371371{
372372 auto rd = prj.pkg .getDirSrc ();
373373 for (auto &[s, f] : file_patches)
@@ -492,7 +492,7 @@ void Project::findSources(path p)
492492
493493 auto create_regex = [&p](const auto &e)
494494 {
495- auto s = normalize_path (p);
495+ auto s = to_printable_string ( normalize_path (p) );
496496 s = escape_regex_symbols (s);
497497 if (!s.empty () && s.back () != ' /' )
498498 s += " /" ;
@@ -510,7 +510,7 @@ void Project::findSources(path p)
510510 if (!fs::is_regular_file (f))
511511 continue ;
512512
513- auto s = normalize_path (f);
513+ auto s = to_printable_string ( normalize_path (f) );
514514 for (auto &e : rgxs)
515515 {
516516 if (!std::regex_match (s, e.second ))
@@ -528,7 +528,7 @@ void Project::findSources(path p)
528528 auto to_remove = files;
529529 for (auto &f : files)
530530 {
531- auto s = normalize_path (f);
531+ auto s = to_printable_string ( normalize_path (f) );
532532 for (auto &e : rgxs_exclude)
533533 {
534534 if (!std::regex_match (s, e.second ))
@@ -1292,8 +1292,8 @@ yaml Project::save() const
12921292 ADD_IF_EQU_VAL (library_type, LibraryType::Module, " module" );
12931293 ADD_IF_EQU_VAL (executable_type, ExecutableType::Win32, " win32" );
12941294
1295- ADD_IF_NOT_EMPTY_VAL (root_directory, normalize_path (root_directory));
1296- ADD_IF_NOT_EMPTY_VAL (unpack_directory, normalize_path (unpack_directory));
1295+ ADD_IF_NOT_EMPTY_VAL (root_directory, to_printable_string ( normalize_path (root_directory) ));
1296+ ADD_IF_NOT_EMPTY_VAL (unpack_directory, to_printable_string ( normalize_path (unpack_directory) ));
12971297 ADD_IF_NOT_EMPTY (output_directory);
12981298
12991299 ADD_IF_NOT_EMPTY (output_name);
@@ -1340,11 +1340,11 @@ yaml Project::save() const
13401340 ADD_SET (include_hints, include_hints);
13411341
13421342 for (auto &v : include_directories.public_ )
1343- root[" include_directories" ][" public" ].push_back (normalize_path (v));
1343+ root[" include_directories" ][" public" ].push_back (to_printable_string ( normalize_path (v) ));
13441344 for (auto &v : include_directories.private_ )
1345- root[" include_directories" ][" private" ].push_back (normalize_path (v));
1345+ root[" include_directories" ][" private" ].push_back (to_printable_string ( normalize_path (v) ));
13461346 for (auto &v : include_directories.interface_ )
1347- root[" include_directories" ][" interface" ].push_back (normalize_path (v));
1347+ root[" include_directories" ][" interface" ].push_back (to_printable_string ( normalize_path (v) ));
13481348 saveOptionsMap (root, options);
13491349 ADD_SET (aliases, aliases);
13501350 ADD_SET (checks_prefixes, checks_prefixes);
@@ -1392,7 +1392,7 @@ void Project::patchSources() const
13921392 patch.patchSources (*this , getSources ());
13931393}
13941394
1395- const Files &Project::getSources () const
1395+ const FilesSorted &Project::getSources () const
13961396{
13971397 if (!files.empty ())
13981398 return files;
0 commit comments