[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#501161: cdebconf-newt: Displays too many "*" is accented characters are typed



reassign 501161 newt
forcemerge 501161 430102
thanks

Hello,

On Sun, Oct 05, 2008 at 01:04:03AM +0200, Frans Pop wrote:
> 
> During password entry the frontend displays two asterisks if I type a 
> single accented character like ä or ö using the special keys for those 
> characters on the German keyboard.
> Notable is that the cursor remains on the correct position.
> 
> Example:
> I type:		qwertzöä	(on a US keyboard this is: qwerty;')
> I see:		**********
> Cursor is:	        ^
> 
> Could be this is not a bug in cdebconf but in newt or something.

This is a bug in newt, and is fixed in the current upstream release.

I could test that the attached newt patch fixes the cdebconf bug.
This is also the current version of the NEWT_FLAG_PASSWORD handling in
entry.c

Best Regards,
-- 
Nekral
--- newt-0.52.2-old/entry.c.org	2009-02-26 23:18:30.726625269 +0100
+++ newt-0.52.2/entry.c	2009-02-26 23:24:47.424902210 +0100
@@ -184,13 +184,12 @@
     chptr = en->buf + en->firstChar;
 
     if (en->flags & NEWT_FLAG_PASSWORD) {
-	char *p;
-	tmpptr = alloca(strlen(chptr)+2);
-	strcpy(tmpptr, chptr);
-	for (p = tmpptr; *p; p++)
-	    *p = '*';
+	len = wstrlen(chptr, -1);
+	tmpptr = alloca(len+1);
+	memset(tmpptr, '*', len);
+	tmpptr[len] = '\0';
 	chptr = tmpptr;
-    }			
+    }
 
     len = wstrlen(chptr, -1);
 

Reply to: