Make oldstyle correctly suppress line editing.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 20 Sep 2024 14:29:37 +0000 (10:29 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 20 Sep 2024 14:29:37 +0000 (10:29 -0400)
NEWS.adoc
main.c

index 2d0dcee159e1a2ff97299cca919f4b06cf68ffea..f9c70d64b0392eb9e446061c665f1cec0dbb2cc9 100644 (file)
--- a/NEWS.adoc
+++ b/NEWS.adoc
@@ -2,6 +2,9 @@
 // SPDX-FileCopyrightText: (C) Eric S. Raymond <esr@thyrsus.com>
 // SPDX-License-Identifier: CC-BY-4.0
 
+Repository head::
+  Make oldstyle correctly suppress line editing.
+
 1.19: 2024-06-27::
   Ensore that the KNIVES_VANISH message can't issue twice.
 
diff --git a/main.c b/main.c
index 2dfa8802cb2d6301b176f451e89da8d714076d61..e0e4c58e743afe8ce7c1abc17d2fec88395e2bae 100644 (file)
--- a/main.c
+++ b/main.c
@@ -81,7 +81,7 @@ char *myreadline(const char *prompt) {
                        }
                }
 
-               if (isatty(fileno(settings.scriptfp))) {
+               if (isatty(fileno(settings.scriptfp)) && !settings.oldstyle) {
                        free(buf);               // LCOV_EXCL_LINE
                        return readline(prompt); // LCOV_EXCL_LINE
                } else {