From 2e03a4e08f3a242e4fb4a0f0fa2f780bb425e247 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Kupec?= Date: Thu, 15 Jul 2010 11:40:54 +0200 Subject: [PATCH] removed unused --- src/utils/prompt.cc | 48 ------------------------------------------------ src/utils/prompt.h | 6 ------ 2 files changed, 54 deletions(-) diff --git a/src/utils/prompt.cc b/src/utils/prompt.cc index 279209e..15f92ad 100644 --- a/src/utils/prompt.cc +++ b/src/utils/prompt.cc @@ -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; -} diff --git a/src/utils/prompt.h b/src/utils/prompt.h index 1e18dac..474dc5b 100644 --- a/src/utils/prompt.h +++ b/src/utils/prompt.h @@ -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, -- 2.7.4