From 57c98abb95a08b4f4b6fe1ba012d8d0308305735 Mon Sep 17 00:00:00 2001 From: Faith Okamoto <52177356+faithokamoto@users.noreply.github.com> Date: Mon, 15 Jun 2026 15:43:32 -0700 Subject: [PATCH] catch duplicate path names --- Fasta.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Fasta.cpp b/Fasta.cpp index aa02301..b70d3d6 100644 --- a/Fasta.cpp +++ b/Fasta.cpp @@ -56,6 +56,10 @@ void FastaIndex::readIndexFile(string fname) { // note that fields[0] is the sequence name char* end; string name = split(fields[0], " \t").at(0); // key by first token of name + if (this->count(name)) { + cerr << "Sequence \"" << name << "\" appears multiple times" << endl; + exit(1); + } sequenceNames.push_back(name); this->insert(make_pair(name, FastaIndexEntry(fields[0], atoi(fields[1].c_str()), strtoll(fields[2].c_str(), &end, 10),