Skip to content

Commit 3a0051d

Browse files
committed
Improve check for correct issue number in filename
We can't check for "xml/issue{}.xml" because the directory separator is a backslash on Windows, so just check the complete filename.
1 parent 118aaf8 commit 3a0051d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/issues.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <iterator>
1717
#include <fstream>
1818
#include <sstream>
19+
#include <format>
1920

2021
#include <iostream> // eases debugging
2122

@@ -154,7 +155,7 @@ auto lwg::parse_issue_from_file(std::string tx, std::string const & filename,
154155
k += match.size();
155156
auto l = tx.find('\"', k);
156157
auto num = tx.substr(k, l-k);
157-
if (filename.find(num + ".xml") == filename.npos)
158+
if (!filename.ends_with(std::format("issue{:0>4}.xml", num)))
158159
std::cerr << "warning: issue number " << num << " in " << filename << " does not match issue number\n";
159160
is.num = std::stoi(num);
160161

0 commit comments

Comments
 (0)