From 40d5d53c5e12dced0b6b8c4f852ef104e8857493 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 31 Dec 2018 18:38:16 +0100 Subject: [PATCH] improve an error message when a file cannot be open --- src/surf/xml/surfxml_sax_cb.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 1b920ef2a5..9b294a43c0 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -968,10 +968,11 @@ void surf_parse_open(std::string file) surf_parsed_filename = file; std::string dir = simgrid::xbt::Path(file).get_dir_name(); surf_path.push_back(dir); + std::string cwd = simgrid::xbt::Path().get_dir_name(); surf_file_to_parse = surf_fopen(file, "r"); if (surf_file_to_parse == nullptr) - xbt_die("Unable to open '%s'\n", file.c_str()); + xbt_die("Unable to open '%s' from '%s'\n", file.c_str(), cwd.c_str()); surf_input_buffer = surf_parse__create_buffer(surf_file_to_parse, YY_BUF_SIZE); surf_parse__switch_to_buffer(surf_input_buffer); surf_parse_lineno = 1; -- 2.20.1