Skip to content

Commit

Permalink
Per #1906, modify code to pass entire path to make_temp_file_name ins…
Browse files Browse the repository at this point in the history
…tead of only the filename so that the function can tell whether or not the file exists.
  • Loading branch information
Julie Prestopnik committed Oct 26, 2021
1 parent 33ede39 commit ea87dac
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions met/src/basic/vx_config/config_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,10 @@ if ( empty(name) ) {

DictionaryStack DS(*this);
ConcatString temp_filename = get_tmp_dir();

temp_filename << "/" << make_temp_file_name("met_config", 0);


temp_filename << "/" << "met_config";
temp_filename = make_temp_file_name(temp_filename.c_str(), 0);

recursive_envs(name, temp_filename.c_str());

bison_input_filename = (const char *) temp_filename.c_str();
Expand Down Expand Up @@ -422,9 +423,10 @@ if ( empty(s) ) {
ofstream out;
ConcatString temp_filename = get_tmp_dir();

temp_filename << "/" << make_temp_file_name("config", ".temp");

out.open(temp_filename.c_str());
temp_filename << "/" << "met_config";
temp_filename = make_temp_file_name(temp_filename.c_str(), 0);

out.open(temp_filename.c_str());

if ( ! out ) {

Expand Down

0 comments on commit ea87dac

Please sign in to comment.