diff --git a/src/wreadln.c b/src/wreadln.c
index cc703898bdeac1c8d72f2074490c187e63c85ccc..d01cfcb87c8517544c930cc5a86b9b8ba1440af2 100644 (file)
--- a/src/wreadln.c
+++ b/src/wreadln.c
*
*/
-#include "config.h"
-
#include "wreadln.h"
+#include "charset.h"
+#include "config.h"
#include <stdlib.h>
#include <string.h>
extern void sigstop(void);
extern void screen_bell(void);
-extern size_t my_strlen(char *str);
#ifndef USE_NCURSESW
/* move the cursor one step to the right */
/* clear input area */
whline(w, ' ', width);
/* print visible part of the line buffer */
- if(masked == TRUE) whline(w, '*', my_strlen(line)-start);
+ if(masked == TRUE) whline(w, '*', utf8_width(line) - start);
else waddnstr(w, line+start, width);
/* move the cursor to the correct position */
wmove(w, y, x0 + cursor-start);
line[cursor] = 0;
break;
case KEY_CTRL_U:
- cursor = my_strlen(line);
+ cursor = utf8_width(line);
for (i = 0;i < cursor; i++)
line[i] = '\0';
cursor = 0;
break;
case KEY_DC: /* handle delete key. As above */
case KEY_CTRL_D:
- if (cursor <= (gint)my_strlen(line) - 1) {
+ if (cursor <= (gint)utf8_width(line) - 1) {
for (i = cursor; line[i] != 0; i++)
line[i] = line[i + 1];
}