fortrangoingonforty/ferp / e34a89e

Browse files

Preserve trailing whitespace in output

Remove trim() calls when printing matched lines to preserve trailing
whitespace. This fixes cases where whitespace patterns would not
display correctly in output.
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
e34a89eddf6bb46e5045c251f030d3faddfb3bff
Parents
3df9d92
Tree
d338db4

1 changed file

StatusFile+-
M src/ferp_output.f90 9 9
src/ferp_output.f90modified
@@ -77,11 +77,11 @@ contains
77
       write(output_unit, '(A)', advance='no') char(9)  ! TAB
77
       write(output_unit, '(A)', advance='no') char(9)  ! TAB
78
     end if
78
     end if
79
 
79
 
80
-    ! Print the line
80
+    ! Print the line (preserve trailing whitespace)
81
     if (opts%null_data) then
81
     if (opts%null_data) then
82
-      write(output_unit, '(A,A)', advance='no') trim(line), char(0)
82
+      write(output_unit, '(A,A)', advance='no') line, char(0)
83
     else
83
     else
84
-      write(output_unit, '(A)') trim(line)
84
+      write(output_unit, '(A)') line
85
     end if
85
     end if
86
 
86
 
87
     ! Line-buffered mode
87
     ! Line-buffered mode
@@ -126,11 +126,11 @@ contains
126
       write(output_unit, '(A)', advance='no') char(9)
126
       write(output_unit, '(A)', advance='no') char(9)
127
     end if
127
     end if
128
 
128
 
129
-    ! Print the line
129
+    ! Print the line (preserve trailing whitespace)
130
     if (opts%null_data) then
130
     if (opts%null_data) then
131
-      write(output_unit, '(A,A)', advance='no') trim(line), char(0)
131
+      write(output_unit, '(A,A)', advance='no') line, char(0)
132
     else
132
     else
133
-      write(output_unit, '(A)') trim(line)
133
+      write(output_unit, '(A)') line
134
     end if
134
     end if
135
 
135
 
136
     ! Line-buffered mode
136
     ! Line-buffered mode
@@ -377,11 +377,11 @@ contains
377
         end if
377
         end if
378
       end if
378
       end if
379
     else
379
     else
380
-      ! No color - just print the line
380
+      ! No color - just print the line (preserve trailing whitespace)
381
       if (opts%null_data) then
381
       if (opts%null_data) then
382
-        write(output_unit, '(A,A)', advance='no') trim(line), char(0)
382
+        write(output_unit, '(A,A)', advance='no') line, char(0)
383
       else
383
       else
384
-        write(output_unit, '(A)') trim(line)
384
+        write(output_unit, '(A)') line
385
       end if
385
       end if
386
     end if
386
     end if
387
 
387