Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libedit PR/54279: Jonathan Perkins: Ignore adjacent star...
details: https://anonhg.NetBSD.org/src/rev/7ce0d2d10d72
branches: trunk
changeset: 841914:7ce0d2d10d72
user: christos <christos%NetBSD.org@localhost>
date: Fri Jun 07 15:18:20 2019 +0000
description:
PR/54279: Jonathan Perkins: Ignore adjacent start/end prompt ignore.
diffstat:
lib/libedit/readline.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diffs (35 lines):
diff -r 71c0e6018ab2 -r 7ce0d2d10d72 lib/libedit/readline.c
--- a/lib/libedit/readline.c Fri Jun 07 13:49:23 2019 +0000
+++ b/lib/libedit/readline.c Fri Jun 07 15:18:20 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.c,v 1.152 2019/04/26 16:56:57 christos Exp $ */
+/* $NetBSD: readline.c,v 1.153 2019/06/07 15:18:20 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.152 2019/04/26 16:56:57 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.153 2019/06/07 15:18:20 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@@ -258,8 +258,14 @@
if (rl_prompt == NULL)
return -1;
- while ((p = strchr(rl_prompt, RL_PROMPT_END_IGNORE)) != NULL)
- *p = RL_PROMPT_START_IGNORE;
+ while ((p = strchr(rl_prompt, RL_PROMPT_END_IGNORE)) != NULL) {
+ /* Remove adjacent end/start markers to avoid double-escapes. */
+ if (p[1] == RL_PROMPT_START_IGNORE) {
+ memmove(p, p + 2, 1 + strlen(p + 2));
+ } else {
+ *p = RL_PROMPT_START_IGNORE;
+ }
+ }
return 0;
}
Home |
Main Index |
Thread Index |
Old Index