[flang-commits] [PATCH] D152201: [flang] Pad output correctly after tabbing with ADVANCE='no' (bug#63111)
    Peter Klausler via Phabricator via flang-commits 
    flang-commits at lists.llvm.org
       
    Mon Jun  5 15:36:09 PDT 2023
    
    
  
This revision was automatically updated to reflect the committed changes.
Closed by commit rG885b904a7065: [flang] Pad output correctly after tabbing with ADVANCE='no' (bug#63111) (authored by klausler).
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152201/new/
https://reviews.llvm.org/D152201
Files:
  flang/runtime/io-stmt.cpp
Index: flang/runtime/io-stmt.cpp
===================================================================
--- flang/runtime/io-stmt.cpp
+++ flang/runtime/io-stmt.cpp
@@ -335,8 +335,8 @@
   } else { // output
     if (mutableModes().nonAdvancing) {
       // Make effects of positioning past the last Emit() visible with blanks.
-      std::int64_t n{unit().positionInRecord - unit().furthestPositionInRecord};
-      while (n-- > 0 && unit().Emit(" ", 1, 1, *this)) {
+      if (unit().positionInRecord > unit().furthestPositionInRecord) {
+        unit().Emit("", 0, 1, *this); // Emit() will pad
       }
       unit().leftTabLimit = unit().positionInRecord;
     } else {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152201.528607.patch
Type: text/x-patch
Size: 670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230605/97fe5877/attachment-0001.bin>
    
    
More information about the flang-commits
mailing list