]> git.wh0rd.org Git - nano.git/commitdiff
make the UTF-8 character reading support work in more instances
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Fri, 15 Oct 2004 01:51:36 +0000 (01:51 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Fri, 15 Oct 2004 01:51:36 +0000 (01:51 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1991 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/winio.c

index d772a97bb0223d41a74a8830304bf55e5b3f83ae..fc4eb2a8474bc0b63a469bffafb9077f83b86663 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -71,8 +71,8 @@ CVS code -
          suggested by Bill Soudan)
        - Remove the -D/--dos and -M/--mac command line options, as they
          aren't much use with the new file format autodetection. (DLR)
-       - Add support for reading in UTF-8 sequences to some of the
-         low-level input routines.  Changes to get_kbinput() and
+       - Add support for reading in UTF-8 sequences to the low-level
+         input routines.  Changes to get_kbinput() and
          get_translated_kbinput(). (DLR)
 - files.c:
   do_insertfile()
index 226a78974054ec75a139b2cad5167901027ece80..50ba44b596a3a8ed6bd78f5ea9f30d7667494fd7 100644 (file)
@@ -376,12 +376,6 @@ int get_translated_kbinput(int kbinput, seq_type *seq
                            break;
 #endif
                        default:
-                           /* A character with its high bit set: UTF-8
-                            * sequence mode.  Set seq to UTF8_SEQ. */
-                           if ((-128 <= kbinput && kbinput < 0) ||
-                               (127 < kbinput && kbinput <= 255))
-                               *seq = UTF8_SEQ;
-
                            retval = kbinput;
                            break;
                    }
@@ -461,6 +455,11 @@ int get_translated_kbinput(int kbinput, seq_type *seq
            }
     }
 
+    /* A character other than ERR with its high bit set: UTF-8 sequence
+     * mode.  Set seq to UTF8_SEQ. */
+    if (retval != ERR && 127 < retval && retval <= 255)
+       *seq = UTF8_SEQ;
+
 #ifdef DEBUG
     fprintf(stderr, "get_translated_kbinput(): kbinput = %d, seq = %d, escapes = %d, ascii_digits = %lu, retval = %d\n", kbinput, (int)*seq, escapes, (unsigned long)ascii_digits, retval);
 #endif