summaryrefslogtreecommitdiff
path: root/src/cmds.c
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1996-08-16 23:14:09 +0000
committerKarl Heuer <kwzh@gnu.org>1996-08-16 23:14:09 +0000
commit9ce18d3a6673c8674c8456c9f987602450085fd9 (patch)
tree34471cbd04b9fd4ce30ab19514e9b323e7a3189f /src/cmds.c
parenteaeb8cd5f3b8b391f0d080b3be82361e1961027a (diff)
downloademacs-9ce18d3a6673c8674c8456c9f987602450085fd9.tar.gz
(Fdelete_backward_char): Fix off-by-one error.
Treat deleted newline specially.
Diffstat (limited to 'src/cmds.c')
-rw-r--r--src/cmds.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmds.c b/src/cmds.c
index 5c0f7cd4751..9c29982cc80 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -208,19 +208,19 @@ N was explicitly specified.")
Lisp_Object n, killflag;
{
Lisp_Object value;
- int deleted_tab = 0;
+ int deleted_special = 0;
int i;
CHECK_NUMBER (n, 0);
- /* See if we are about to delete a tab backwards. */
- for (i = 0; i < XINT (n); i++)
+ /* See if we are about to delete a tab or newline backwards. */
+ for (i = 1; i <= XINT (n); i++)
{
if (point - i < BEGV)
break;
- if (FETCH_CHAR (point - i) == '\t')
+ if (FETCH_CHAR (point - i) == '\t' || FETCH_CHAR (point - i) == '\n')
{
- deleted_tab = 1;
+ deleted_special = 1;
break;
}
}
@@ -231,7 +231,7 @@ N was explicitly specified.")
unless at end of line. */
if (XINT (n) > 0
&& ! NILP (current_buffer->overwrite_mode)
- && ! deleted_tab
+ && ! deleted_special
&& ! (point == ZV || FETCH_CHAR (point) == '\n'))
{
Finsert_char (make_number (' '), XINT (n));