summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-04-10 14:32:16 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-04-10 14:32:16 +0200
commit71d9447316133c8e447ca7538d9533e1ef61e0eb (patch)
tree2c59aca8ad2f671f458065eb8e7554a3cd9a64ed /src/main.c
parentdc7fe1e2405c49338e5dca5f559f17e8c5977b98 (diff)
downloadpianobar-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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 06f5975..8de5d6f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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");
}