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
7777
       write(output_unit, '(A)', advance='no') char(9)  ! TAB
7878
     end if
7979
 
80
-    ! Print the line
80
+    ! Print the line (preserve trailing whitespace)
8181
     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)
8383
     else
84
-      write(output_unit, '(A)') trim(line)
84
+      write(output_unit, '(A)') line
8585
     end if
8686
 
8787
     ! Line-buffered mode
@@ -126,11 +126,11 @@ contains
126126
       write(output_unit, '(A)', advance='no') char(9)
127127
     end if
128128
 
129
-    ! Print the line
129
+    ! Print the line (preserve trailing whitespace)
130130
     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)
132132
     else
133
-      write(output_unit, '(A)') trim(line)
133
+      write(output_unit, '(A)') line
134134
     end if
135135
 
136136
     ! Line-buffered mode
@@ -377,11 +377,11 @@ contains
377377
         end if
378378
       end if
379379
     else
380
-      ! No color - just print the line
380
+      ! No color - just print the line (preserve trailing whitespace)
381381
       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)
383383
       else
384
-        write(output_unit, '(A)') trim(line)
384
+        write(output_unit, '(A)') line
385385
       end if
386386
     end if
387387