Code

lyrics: fixed XML tag removal on wikia.com
[ncmpc.git] / src / screen_client.c
index 0b3484e3a371582f7590092055f8d3a00bd6886c..6eb9bf4964de2f2950a60ae021fd65346eac0a46 100644 (file)
@@ -1,5 +1,5 @@
 /* ncmpc (Ncurses MPD Client)
- * (c) 2004-2009 The Music Player Daemon Project
+ * (c) 2004-2010 The Music Player Daemon Project
  * Project homepage: http://musicpd.org
  *
  * This program is free software; you can redistribute it and/or modify
@@ -19,7 +19,7 @@
 
 #include "screen_client.h"
 #include "screen_utils.h"
-#include "screen_message.h"
+#include "screen_status.h"
 #include "mpdclient.h"
 #include "i18n.h"
 #include "charset.h"
 static bool
 _screen_auth(struct mpdclient *c, gint recursion)
 {
-       struct mpd_connection *connection;
-       char *password;
-
-       connection = mpdclient_get_connection(c);
+       struct mpd_connection *connection = mpdclient_get_connection(c);
        if (connection == NULL)
                return false;
 
@@ -38,7 +35,7 @@ _screen_auth(struct mpdclient *c, gint recursion)
        if (recursion > 2)
                return false;
 
-       password = screen_read_password(NULL);
+       char *password = screen_read_password(NULL);
        if (password == NULL)
                return false;
 
@@ -75,17 +72,14 @@ mpdclient_ui_error(const char *message_utf8)
 void
 screen_database_update(struct mpdclient *c, const char *path)
 {
-       struct mpd_connection *connection;
-       unsigned id;
-
        assert(c != NULL);
        assert(mpdclient_is_connected(c));
 
-       connection = mpdclient_get_connection(c);
+       struct mpd_connection *connection = mpdclient_get_connection(c);
        if (connection == NULL)
                return;
 
-       id = mpd_run_update(connection, path);
+       unsigned id = mpd_run_update(connection, path);
        if (id == 0) {
                if (mpd_connection_get_error(connection) == MPD_ERROR_SERVER &&
                    mpd_connection_get_server_error(connection) == MPD_SERVER_ERROR_UPDATE_ALREADY &&