Commit b93523c0 authored by Max Kellermann's avatar Max Kellermann

UpdateGlue: never pass null to update_enqueue()

parent 7ef40de9
......@@ -468,7 +468,7 @@ int mpd_main(int argc, char *argv[])
if (create_db) {
/* the database failed to load: recreate the
database */
unsigned job = update_enqueue(nullptr, true);
unsigned job = update_enqueue("", true);
if (job == 0)
FatalError("directory update failed");
}
......
......@@ -157,7 +157,7 @@ handle_lsinfo(Client *client, int argc, char *argv[])
enum command_return
handle_update(Client *client, gcc_unused int argc, char *argv[])
{
const char *path = NULL;
const char *path = "";
unsigned ret;
assert(argc <= 2);
......@@ -166,7 +166,7 @@ handle_update(Client *client, gcc_unused int argc, char *argv[])
if (*path == 0 || strcmp(path, "/") == 0)
/* backwards compatibility with MPD 0.15 */
path = NULL;
path = "";
else if (!uri_safe_local(path)) {
command_error(client, ACK_ERROR_ARG,
"Malformed path");
......@@ -188,7 +188,7 @@ handle_update(Client *client, gcc_unused int argc, char *argv[])
enum command_return
handle_rescan(Client *client, gcc_unused int argc, char *argv[])
{
const char *path = NULL;
const char *path = "";
unsigned ret;
assert(argc <= 2);
......
......@@ -20,6 +20,8 @@
#ifndef MPD_UPDATE_GLUE_HXX
#define MPD_UPDATE_GLUE_HXX
#include "Compiler.h"
void update_global_init(void);
void update_global_finish(void);
......@@ -30,10 +32,11 @@ isUpdatingDB(void);
/**
* Add this path to the database update queue.
*
* @param path a path to update; if NULL or an empty string,
* @param path a path to update; if an empty string,
* the whole music directory is updated
* @return the job id, or 0 on error
*/
gcc_nonnull_all
unsigned
update_enqueue(const char *path, bool discard);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment