changeset 20958:806727604be8

(Fdelete_backward_char): Count both bytes and chars.
author Karl Heuer <kwzh@gnu.org>
date Sun, 22 Feb 1998 01:06:06 +0000
parents 25bb3da85d05
children 9b831f34ff7d
files src/cmds.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/cmds.c	Sun Feb 22 01:04:35 1998 +0000
+++ b/src/cmds.c	Sun Feb 22 01:06:06 1998 +0000
@@ -235,18 +235,19 @@
 {
   Lisp_Object value;
   int deleted_special = 0;
-  int pos, i;
+  int pos, pos_byte, i;
 
   CHECK_NUMBER (n, 0);
 
   /* See if we are about to delete a tab or newline backwards.  */
-  pos = PT_BYTE;
-  for (i = 0; i < XINT (n) && pos > BEGV_BYTE; i++)
+  pos = PT;
+  pos_byte = PT_BYTE;
+  for (i = 0; i < XINT (n) && pos_byte > BEGV_BYTE; i++)
     {
       int c;
 
-      DEC_POS (pos);
-      c = FETCH_BYTE (pos);
+      DEC_BOTH (pos, pos_byte);
+      c = FETCH_BYTE (pos_byte);
       if (c == '\t' || c == '\n')
 	{
 	  deleted_special = 1;