Skip to content

Commit

Permalink
Maybe string().c_str() works?
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGoran committed Dec 19, 2024
1 parent 0f4f052 commit 78d8a9a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/ivoc/ivocmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,22 +546,24 @@ nrniv [options] [fileargs]
};
#ifdef WIN32
if (file_exists(nrn_def_path1)) {
session->style()->load_file(String(nrn_def_path1.native()), -5);
session->style()->load_file(String(nrn_def_path1.string().c_str()), -5);
} else if (file_exists(nrn_def_path2)) {
session->style()->load_file(String(nrn_def_path2.native()), -5);
session->style()->load_file(String(nrn_def_path2.string().c_str()), -5);
} else {
char buf[256];
Sprintf(buf, "Can't load NEURON resources from %s[aults]", nrn_def_path1.native());
Sprintf(buf,
"Can't load NEURON resources from %s[aults]",
nrn_def_path1.string().c_str());
printf("%s\n", buf);
}
#else
session->style()->load_file(String(nrn_def_path1.native()), -5);
session->style()->load_file(String(nrn_def_path1.string().c_str()), -5);
#endif
char* h = getenv("HOME");
if (h) {
const auto nrn_def_path_dot = fs::path(h) / ".nrn.defaults";
if (file_exists(nrn_def_path_dot)) {
session->style()->load_file(String(nrn_def_path_dot.native()), -5);
session->style()->load_file(String(nrn_def_path_dot.string().c_str()), -5);

Check warning on line 566 in src/ivoc/ivocmain.cpp

View check run for this annotation

Codecov / codecov/patch

src/ivoc/ivocmain.cpp#L566

Added line #L566 was not covered by tests
}
}
}
Expand Down

0 comments on commit 78d8a9a

Please sign in to comment.