Skip to content

Commit d845433

Browse files
committed
More robustly check skip invalid reads env var
1 parent b69eeaa commit d845433

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <exception>
1818
#include <memory>
1919
#include <ranges>
20+
#include <string>
2021
#include <string_view>
2122
#include <vector>
2223
#include "Framework/TableTreeHelpers.h"
@@ -112,9 +113,13 @@ namespace o2::framework::readers
112113
static bool shouldSkipInvalidReads()
113114
{
114115
auto const* envValue = getenv("DPL_AOD_READER_SKIP_INVALID");
115-
return envValue != nullptr &&
116-
strcmp(envValue, "0") != 0 &&
117-
strcmp(envValue, "false") != 0;
116+
if (envValue == nullptr) {
117+
return false;
118+
}
119+
120+
std::string value{envValue};
121+
std::ranges::transform(value, value.begin(), [](unsigned char c) { return std::tolower(c); });
122+
return !value.empty() && value != "0" && value != "false";
118123
}
119124

120125
static std::string describeException(std::exception const& exception)

0 commit comments

Comments
 (0)