From 1ce25538e61051099d9183848c7295eb2e254fc9 Mon Sep 17 00:00:00 2001
From: "James K. Lowden" <jklowden@symas.com>
Date: Sat, 30 Dec 2023 18:27:11 -0500
Subject: [PATCH] for fixed-format, clear line-number area for short lines, too

---
 gcc/cobol/cdf_text.h | 4 ++++
 gcc/cobol/scan.l     | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/cobol/cdf_text.h b/gcc/cobol/cdf_text.h
index 396fc44cd23a..4f2c281f23c5 100644
--- a/gcc/cobol/cdf_text.h
+++ b/gcc/cobol/cdf_text.h
@@ -151,6 +151,10 @@ cdftext::free_form_reference_format( int input ) {
     
     char *indcol = indicated(mfile.cur, mfile.eol); // true only for fixed format
 
+    if( is_fixed_format() && !indcol ) { // short line
+      erase_source(mfile.cur, mfile.eol);
+    }
+    
     if( indcol ) {
       // Set to blank columns 1-6 and anything past the right margin.
       erase_source(mfile.cur, indcol);
diff --git a/gcc/cobol/scan.l b/gcc/cobol/scan.l
index 6b62969d8123..9dccbfb22df0 100644
--- a/gcc/cobol/scan.l
+++ b/gcc/cobol/scan.l
@@ -987,7 +987,7 @@ USE([[:space:]]+FOR)?		{ return USE; }
   CONSTANT		{ return CONSTANT; }
   CONTAINS		{ return CONTAINS; }
   DATA			{ return DATA; }
-  DEPENDING				{ return DEPENDING; }
+  DEPENDING		{ return DEPENDING; }
   DESCENDING		{ return DESCENDING; }
   DISPLAY		{ return DISPLAY; }
   EJECT			{ return EJECT; }
-- 
GitLab