removed unused
authorJán Kupec <jkupec@suse.cz>
Thu, 15 Jul 2010 09:40:54 +0000 (11:40 +0200)
committerJán Kupec <jkupec@suse.cz>
Thu, 15 Jul 2010 09:40:54 +0000 (11:40 +0200)
src/utils/prompt.cc
src/utils/prompt.h

index 279209e..15f92ad 100644 (file)
@@ -410,51 +410,3 @@ string get_text(const string & prompt, const string & prefilled)
     return line_read;
   return string();
 }
-
-static int silent_getch ( void )
-{
-  int ch;
-  struct termios oldt, newt;
-
-  tcgetattr ( STDIN_FILENO, &oldt );
-  newt = oldt;
-  newt.c_lflag &= ~( ICANON | ECHO );
-  tcsetattr ( STDIN_FILENO, TCSANOW, &newt );
-  ch = getchar();
-  tcsetattr ( STDIN_FILENO, TCSANOW, &oldt );
-
-  return ch;
-}
-
-/** FIXME is there really not some nice standard library call for this???
- * is it possible to get this from readline? */
-/** \todo restore old terminal settings on interrupt */
-string get_password()
-{
-  int ch;
-  char pw[20];
-  unsigned i = 0;
-
-  while ((ch = silent_getch()) != EOF
-          && ch != '\n'
-          && ch != '\r'
-          && i < sizeof(pw) - 1)
-  {
-    if (i && (ch == '\b'  || ch == 127 /* DEL */))
-    {
-//      printf("\b \b"); // does not work for me :O(
-//      fflush(stdout);
-      pw[--i] = '\0';
-    }
-    else if (isalnum(ch))
-    {
-//      putchar('*');
-      pw[i++] = (char)ch;
-    }
-  }
-
-  pw[i] = '\0';
-  cout << endl;
-
-  return pw;
-}
index 1e18dac..474dc5b 100644 (file)
@@ -137,12 +137,6 @@ unsigned int get_prompt_reply(Zypper & zypper,
  */
 std::string get_text(const std::string & prompt, const std::string & prefilled = "");
 
-/**
- * Get text from user without showing the typed text on the terminal.
- * Uses getchar(), not suitable for machines.
- */
-std::string get_password();
-
 /*
 enum Error {
     NO_ERROR,