[quagga-dev 5560] [PATCH] vty.c allow backspace in password entry

quagga at de.vio.us quagga at de.vio.us
Wed Jul 2 22:07:18 BST 2008


I frequently type poorly and would like to be able to use backspace
during password entry for those times when I know I've screwed up even
before I hit enter.  I suspect others would benefit from this as well.

Below is a very trivial patch that seems to do the trick by changing the
bail-out point in vty_delete_char().

				- roy -

Index: vty.c
===================================================================
RCS file: /var/cvsroot/quagga/lib/vty.c,v
retrieving revision 1.57
diff -u -p -w -b -r1.57 vty.c
--- vty.c       10 May 2007 02:38:51 -0000      1.57
+++ vty.c       2 Jul 2008 20:59:16 -0000
@@ -727,9 +727,6 @@ vty_delete_char (struct vty *vty)
   int i;
   int size;
 
-  if (vty->node == AUTH_NODE || vty->node == AUTH_ENABLE_NODE)
-    return;
-
   if (vty->length == 0)
     {
       vty_down_level (vty);
@@ -744,6 +741,9 @@ vty_delete_char (struct vty *vty)
   vty->length--;
   memmove (&vty->buf[vty->cp], &vty->buf[vty->cp + 1], size - 1);
   vty->buf[vty->length] = '\0';
+
+  if (vty->node == AUTH_NODE || vty->node == AUTH_ENABLE_NODE)
+    return;
 
   vty_write (vty, &vty->buf[vty->cp], size - 1);
   vty_write (vty, &telnet_space_char, 1);



More information about the Quagga-dev mailing list