]> Kevux Git Server - fll/commitdiff
Update: print newline for empty content even when --at and --line, so long as --empty...
authorKevin Day <thekevinday@gmail.com>
Fri, 15 Nov 2019 03:12:34 +0000 (21:12 -0600)
committerKevin Day <thekevinday@gmail.com>
Fri, 15 Nov 2019 03:12:34 +0000 (21:12 -0600)
level_3/fss_basic_read/c/private-fss_basic_read.c

index 1cff74fe454c9ac46af2da9987d240f3ee440a7e..463431467f2aacab1f90e75809cb15355cdb3e60 100644 (file)
@@ -430,9 +430,14 @@ extern "C" {
         }
 
         if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) {
-          if (data->contents.array[depths.array[0].value_at].used > 0 && line == 0) {
-            f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[depths.array[0].value_at].array[0]);
-            fprintf(f_standard_output, "%c", f_string_eol);
+          if (line == 0) {
+            if (data->contents.array[depths.array[0].value_at].used > 0) {
+              f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[depths.array[0].value_at].array[0]);
+              fprintf(f_standard_output, "%c", f_string_eol);
+            }
+            else if (include_empty) {
+              fprintf(f_standard_output, "%c", f_string_eol);
+            }
           }
 
           return f_none;
@@ -442,6 +447,9 @@ extern "C" {
           f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[depths.array[0].value_at].array[0]);
           fprintf(f_standard_output, "%c", f_string_eol);
         }
+        else if (include_empty) {
+          fprintf(f_standard_output, "%c", f_string_eol);
+        }
       }
 
       return f_none;