X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/172a73b13fe909117c7fbf3d69d4ce5e87efdbc6..3e5588fc9b34239f448a523211086b05c9fee29c:/src/surf/xml/surfxml_sax_cb.cpp?ds=sidebyside diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index f67afd6ed4..d1c94568cf 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -7,7 +7,7 @@ #include "simgrid/sg_config.h" #include "src/kernel/routing/NetPoint.hpp" #include "src/surf/network_interface.hpp" -#include "xbt/file.h" +#include "xbt/file.hpp" #include "src/surf/xml/platf_private.hpp" #include @@ -1069,9 +1069,8 @@ void surf_parse_open(const char *file) xbt_assert(file, "Cannot parse the nullptr file. Bypassing the parser is strongly deprecated nowadays."); surf_parsed_filename = xbt_strdup(file); - char* dir = xbt_dirname(file); - surf_path.push_back(std::string(dir)); - xbt_free(dir); + std::string dir = simgrid::xbt::Path(file).getDirname(); + surf_path.push_back(dir); surf_file_to_parse = surf_fopen(file, "r"); if (surf_file_to_parse == nullptr)