diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-04-10 14:32:16 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-04-10 14:32:16 +0200 |
commit | 71d9447316133c8e447ca7538d9533e1ef61e0eb (patch) | |
tree | 2c59aca8ad2f671f458065eb8e7554a3cd9a64ed /src/main.c | |
parent | dc7fe1e2405c49338e5dca5f559f17e8c5977b98 (diff) | |
download | pianobar-71d9447316133c8e447ca7538d9533e1ef61e0eb.tar.gz pianobar-71d9447316133c8e447ca7538d9533e1ef61e0eb.tar.bz2 pianobar-71d9447316133c8e447ca7538d9533e1ef61e0eb.zip |
Goodbye readline
"It's too big and too slow." -- man readline
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -44,8 +44,6 @@ THE SOFTWARE. #include <pthread.h> -#include <readline/readline.h> - /* pandora.com library */ #include <piano.h> @@ -55,6 +53,7 @@ THE SOFTWARE. #include "terminal.h" #include "config.h" #include "ui.h" +#include "ui_readline.h" int main (int argc, char **argv) { /* handles */ @@ -79,6 +78,7 @@ int main (int argc, char **argv) { BarUiMsg (MSG_NONE, "Welcome to " PACKAGE "!\n"); /* init some things */ + BarTermSetEcho (0); curl_global_init (CURL_GLOBAL_SSL); xmlInitParser (); ao_initialize (); @@ -101,14 +101,16 @@ int main (int argc, char **argv) { } if (settings.username == NULL) { + char nameBuf[100]; BarUiMsg (MSG_QUESTION, "Username: "); - settings.username = readline (NULL); + BarReadlineStr (nameBuf, sizeof (nameBuf), 0); + settings.username = strdup (nameBuf); } if (settings.password == NULL) { - BarTermSetEcho (0); + char passBuf[100]; BarUiMsg (MSG_QUESTION, "Password: "); - settings.password = readline (NULL); - BarTermSetEcho (1); + BarReadlineStr (passBuf, sizeof (passBuf), 1); + settings.password = strdup (passBuf); BarUiMsg (MSG_NONE, "\n"); } |