[flang-commits] [flang] 4fcefbd - [flang][runtime] Emit leading space before zero-length list-directed … (#77835)
via flang-commits
flang-commits at lists.llvm.org
Mon Jan 15 12:52:22 PST 2024
Author: Peter Klausler
Date: 2024-01-15T12:52:18-08:00
New Revision: 4fcefbd3a41d77b2471c78c5b2e50d058ee46b97
URL: https://github.com/llvm/llvm-project/commit/4fcefbd3a41d77b2471c78c5b2e50d058ee46b97
DIFF: https://github.com/llvm/llvm-project/commit/4fcefbd3a41d77b2471c78c5b2e50d058ee46b97.diff
LOG: [flang][runtime] Emit leading space before zero-length list-directed … (#77835)
…character
Don't omit the leading space in list-directed output before a line
comprising only a zero-length character value.
Fixes https://github.com/llvm/llvm-project/issues/77736.
Added:
Modified:
flang/runtime/io-stmt.cpp
Removed:
################################################################################
diff --git a/flang/runtime/io-stmt.cpp b/flang/runtime/io-stmt.cpp
index 7052a6acf41ce0..3ec01ffba9bf06 100644
--- a/flang/runtime/io-stmt.cpp
+++ b/flang/runtime/io-stmt.cpp
@@ -698,9 +698,6 @@ void FormattedIoStatementState<Direction::Input>::GotChar(int n) {
bool ListDirectedStatementState<Direction::Output>::EmitLeadingSpaceOrAdvance(
IoStatementState &io, std::size_t length, bool isCharacter) {
- if (length == 0) {
- return true;
- }
const ConnectionState &connection{io.GetConnectionState()};
int space{connection.positionInRecord == 0 ||
!(isCharacter && lastWasUndelimitedCharacter())};
More information about the flang-commits
mailing list