uint64_t LineNumber = 0;
for (StringRef Line : llvm::split((*HeadersFile)->getBuffer(), '\n')) {
LineNumber++;
+ if (!Line.empty() && Line.back() == '\r')
+ Line = Line.drop_back();
if (!isHeader(Line)) {
if (!all_of(Line, llvm::isSpace))
WithColor::warning()
<< LineNumber << '\n';
continue;
}
- if (Line.back() == '\r')
- Line = Line.drop_back();
Headers.emplace_back(Line);
}
return Headers;
RUN: %python %S/Inputs/capture_req.py llvm-debuginfod-find --debuginfo 0 \
RUN: | FileCheck --check-prefix NO-HEADERS %s
-RUN: DEBUGINFOD_HEADERS_FILE=bad %python %S/Inputs/capture_req.py \
+RUN: env DEBUGINFOD_HEADERS_FILE=bad %python %S/Inputs/capture_req.py \
RUN: llvm-debuginfod-find --debuginfo 0 \
RUN: | FileCheck --check-prefix NO-HEADERS %s
-RUN: DEBUGINFOD_HEADERS_FILE=%S/Inputs/headers %python %S/Inputs/capture_req.py \
+RUN: env DEBUGINFOD_HEADERS_FILE=%S/Inputs/headers %python %S/Inputs/capture_req.py \
RUN: llvm-debuginfod-find --debuginfo 0 \
RUN: | FileCheck --check-prefix HEADERS %s
-RUN: DEBUGINFOD_HEADERS_FILE=%S/Inputs/headers DEBUGINFOD_URLS=fake not llvm-debuginfod-find --debuginfo 0 2>&1 \
+RUN: env DEBUGINFOD_HEADERS_FILE=%S/Inputs/headers DEBUGINFOD_URLS=fake not llvm-debuginfod-find --debuginfo 0 2>&1 \
RUN: | FileCheck --check-prefix ERR -DHEADER_FILE=%S/Inputs/headers %s
NO-HEADERS: Accept: */*