Module Name: src
Committed By: christos
Date: Sat Jun 29 17:28:07 UTC 2024
Modified Files:
src/lib/libedit: emacs.c
Log Message:
don't use oldc before it is set.
To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libedit/emacs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libedit/emacs.c
diff -u src/lib/libedit/emacs.c:1.37 src/lib/libedit/emacs.c:1.38
--- src/lib/libedit/emacs.c:1.37 Sat Jun 29 10:09:35 2024
+++ src/lib/libedit/emacs.c Sat Jun 29 13:28:07 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: emacs.c,v 1.37 2024/06/29 14:09:35 christos Exp $ */
+/* $NetBSD: emacs.c,v 1.38 2024/06/29 17:28:07 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)emacs.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: emacs.c,v 1.37 2024/06/29 14:09:35 christos Exp $");
+__RCSID("$NetBSD: emacs.c,v 1.38 2024/06/29 17:28:07 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -452,7 +452,7 @@ em_copy_prev_word(EditLine *el, wint_t c
cp = c__prev_word(el->el_line.cursor, el->el_line.buffer,
el->el_state.argument, ce__isword);
- c_insert(el, (int)(oldc - cp));
+ c_insert(el, (int)(el->el_line.cursor - cp));
oldc = el->el_line.cursor;
for (dp = oldc; cp < oldc && dp < el->el_line.lastchar; cp++)
*dp++ = *cp;