Skip to content

Commit

Permalink
Fixing idrup issue
Browse files Browse the repository at this point in the history
  • Loading branch information
msoos committed Sep 28, 2024
1 parent dba1f68 commit 08d23f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,7 @@ void Main::manually_parse_some_options()
"the input file and the output FRAT file" << endl;
exit(-1);
}

if (!files.empty()) {
input_file = files[0];
#ifdef USE_SQLITE3
Expand All @@ -1170,16 +1171,15 @@ void Main::manually_parse_some_options()
#endif
fileNamePresent = true;
} else assert(false && "The try() should not have succeeded");

if ((files.size() > 1 || conf.simulate_frat) && !conf.idrup) {
if (files.size() > 1) {
assert(!conf.simulate_frat && "You can't have both simulation of FRAT and frat");
frat_fname = files[1];
}
handle_frat_option();
} else {
if (files.size() > 1 && conf.idrup) {
idrup_fname = files[1];
}
} else if (files.size() > 1 && conf.idrup) {
idrup_fname = files[1];
handle_idrup_option();
}
} catch (std::logic_error& e) {
Expand Down
24 changes: 10 additions & 14 deletions src/main_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,17 @@ using namespace CMSat;

void MainCommon::handle_frat_option()
{
if (!conf.simulate_frat) {
FILE* fratfTmp = fopen(frat_fname.c_str(), "wb");
if (fratfTmp == nullptr) {
std::cerr
<< "ERROR: Could not open FRAT file "
<< frat_fname
<< " for writing"
<< endl;
if (conf.simulate_frat) return;

std::exit(-1);
}
fratf = fratfTmp;
FILE* fratfTmp = fopen(frat_fname.c_str(), "wb");
if (fratfTmp == nullptr) {
std::cerr
<< "ERROR: Could not open FRAT file '" << frat_fname << "' for writing"
<< endl;

std::exit(-1);
}
fratf = fratfTmp;
}

void MainCommon::handle_idrup_option()
Expand All @@ -53,9 +51,7 @@ void MainCommon::handle_idrup_option()
FILE* idrupfTmp = fopen(idrup_fname.c_str(), "w");
if (idrupfTmp == NULL) {
std::cerr
<< "ERROR: Could not open IDRUP file "
<< idrup_fname
<< " for writing"
<< "ERROR: Could not open IDRUP file '" << idrup_fname << "' for writing"
<< endl;

std::exit(-1);
Expand Down

0 comments on commit 08d23f9

Please sign in to comment.