Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New XBT module: file
[simgrid.git] / src / surf / surfxml_parse.c
index 4e90aa2..e7f1b45 100644 (file)
@@ -7,11 +7,11 @@
 #include <errno.h>
 #include <math.h>
 #include <stdarg.h> /* va_arg */
-#include <libgen.h>
 
 #include "xbt/misc.h"
 #include "xbt/log.h"
 #include "xbt/str.h"
+#include "xbt/file.h"
 #include "xbt/dict.h"
 #include "surf/surfxml_parse.h"
 #include "surf/surf_private.h"
@@ -324,7 +324,7 @@ void ETag_surfxml_include(void) {
 
 /** @brief When reaching EOF, check whether we are in an include tag, and behave accordingly if yes
  *
- * This function is called automatically by sedding the parser in buildtools/Cmake/MaintainerMode.cmake
+ * This function is called automatically by sedding the parser in tools/cmake/MaintainerMode.cmake
  * Every FAIL on "Premature EOF" is preceded by a call to this function, which role is to restore the
  * previous buffer if we reached the EOF /of an include file/. Its return code is used to avoid the
  * error message in that case.
@@ -1028,8 +1028,8 @@ void surf_parse_open(const char *file)
 
   if (!surf_parsed_filename_stack)
     surf_parsed_filename_stack = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
-  surf_parsed_filename = xbt_strdup(file);
-  char *dir = dirname(surf_parsed_filename);
+
+  char *dir = xbt_dirname(file);
   xbt_dynar_push(surf_path, &dir);
 
   surf_file_to_parse = surf_fopen(file, "r");