Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit PR/56778: Detlev Casanova: Missing rl_initialize...



details:   https://anonhg.NetBSD.org/src/rev/71a77dc221bb
branches:  trunk
changeset: 364713:71a77dc221bb
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Apr 08 20:11:31 2022 +0000

description:
PR/56778: Detlev Casanova: Missing rl_initialize call in rl_copy_text

diffstat:

 lib/libedit/readline.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 4622f22141b6 -r 71a77dc221bb lib/libedit/readline.c
--- a/lib/libedit/readline.c    Fri Apr 08 14:33:24 2022 +0000
+++ b/lib/libedit/readline.c    Fri Apr 08 20:11:31 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readline.c,v 1.173 2022/02/19 17:45:02 christos Exp $  */
+/*     $NetBSD: readline.c,v 1.174 2022/04/08 20:11:31 christos Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.173 2022/02/19 17:45:02 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.174 2022/04/08 20:11:31 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include <sys/types.h>
@@ -2307,10 +2307,15 @@
 char *
 rl_copy_text(int from, int to)
 {
-       const LineInfo *li = el_line(e);
+       const LineInfo *li;
        size_t len;
        char * out;
 
+       if (h == NULL || e == NULL)
+               rl_initialize();
+
+       li = el_line(e);
+
        if (from > to)
                return NULL;
 



Home | Main Index | Thread Index | Old Index