Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use simgrid::xbt::Path instead of xbt_{base,dir}name in C++ files.
[simgrid.git] / src / simdag / sd_daxloader.cpp
index 409caee..eb18b68 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "simdag_private.hpp"
 #include "simgrid/simdag.h"
-#include "xbt/file.h" /* xbt_basename() */
+#include "xbt/file.hpp"
 #include "xbt/log.h"
 #include "xbt/misc.h"
 #include <map>
@@ -241,9 +241,8 @@ xbt_dynar_t SD_daxload(const char *filename)
   }
 
   if (not acyclic_graph_detail(result)) {
-    char* base = xbt_basename(filename);
-    XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.", base);
-    free(base);
+    std::string base = simgrid::xbt::Path(filename).getBasename();
+    XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.", base.c_str());
     xbt_dynar_foreach(result, cpt, file)
       SD_task_destroy(file);
     xbt_dynar_free_container(&result);