From c5e317aba07ceb0f9ad88973c3edcce5428cfd5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sat, 14 Aug 2021 13:48:12 +0100 Subject: [PATCH] echo empty lines readline doesn't echo empty lines (when not using a prompt), so adjust bc to echo empty lines, which is very useful to delimit interactive input --- bc-1.07.1-readline-echo-empty.diff | 14 ++++++++++++++ bc.spec | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 bc-1.07.1-readline-echo-empty.diff diff --git a/bc-1.07.1-readline-echo-empty.diff b/bc-1.07.1-readline-echo-empty.diff new file mode 100644 index 0000000..1b2c034 --- /dev/null +++ b/bc-1.07.1-readline-echo-empty.diff @@ -0,0 +1,14 @@ +diff -Naur bc-1.07.1/bc/scan.l bc-1.07.1-new/bc/scan.l +--- bc-1.07.1/bc/scan.l 2017-04-07 22:20:02.000000000 +0000 ++++ bc-1.07.1-new/bc/scan.l 2021-08-14 12:12:33.860991777 +0000 +@@ -170,6 +170,10 @@ + if (rl_len != 1) + add_history (rl_line); + rl_line[rl_len-1] = '\n'; ++ /* readline doesn't echo empty lines without a prompt, ++ so do so here. */ ++ if (rl_len == 1) ++ putchar ('\n'); + fflush (stdout); + } + diff --git a/bc.spec b/bc.spec index fcceeeb..cf45e86 100644 --- a/bc.spec +++ b/bc.spec @@ -1,12 +1,13 @@ Summary: GNU's bc (a numeric processing language) and dc (a calculator) Name: bc Version: 1.07.1 -Release: 13%{?dist} +Release: 14%{?dist} License: GPLv2+ URL: http://www.gnu.org/software/bc/ Source: http://ftp.gnu.org/gnu/bc/bc-%{version}.tar.gz Patch1: bc-1.06-dc_ibase.patch Patch2: bc-1.06.95-doc.patch +Patch3: bc-1.07.1-readline-echo-empty.diff BuildRequires: gcc BuildRequires: readline-devel, flex, bison, texinfo, ed BuildRequires: make @@ -40,6 +41,9 @@ rm -f $RPM_BUILD_ROOT/%{_infodir}/dir %{_infodir}/* %changelog +* Sat Aug 14 2021 Pádraig Brady - 1.07.1-14 +- Echo empty lines, useful for delimiting work + * Wed Jul 21 2021 Fedora Release Engineering - 1.07.1-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild