Skip to content

Commit

Permalink
Don't write outputfile when outputfile is same as inputfile
Browse files Browse the repository at this point in the history
  • Loading branch information
xoltar committed Feb 28, 2019
1 parent 06d3541 commit f13127d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions console.cpp
Expand Up @@ -380,7 +380,7 @@ int main(int argc, char* argv[])
print_betti(message, std::cout);

//if an output file has been specified, then save the Betti numbers in an arrangement file (with no barcode templates)
if (!params.outputFile.empty()) {
if (!params.outputFile.empty() && !(params.outputFile == params.fileName)) {
std::ofstream file(params.outputFile);
if (file.is_open()) {
std::vector<exact> emptyvec;
Expand Down Expand Up @@ -454,7 +454,7 @@ int main(int argc, char* argv[])

}
//if an output file has been specified, then save the arrangement
if (!params.outputFile.empty()) {
if (!params.outputFile.empty() && !(params.fileName == params.outputFile)) {
std::ofstream file(params.outputFile);
if (file.is_open()) {
if (arrangement == nullptr) {
Expand Down

0 comments on commit f13127d

Please sign in to comment.