From ef767a08a436298400f449e85c9307f2bc1f3645 Mon Sep 17 00:00:00 2001 From: Wolfgang Scherer Date: Mon, 13 Nov 2017 04:40:12 +0100 Subject: [PATCH] [db] Report directory names that end in spaces --- src/db.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/db.c b/src/db.c index 0a8f3543..c1bcded9 100644 --- a/src/db.c +++ b/src/db.c @@ -3412,8 +3412,17 @@ db_directory_add(struct directory_info *di, int *id) char *query; char *errmsg; + int vp_len = strlen(di->virtual_path); int ret; + if (vp_len && di->virtual_path[vp_len-1] == ' ') + { + /* Since sqlite removes the trailing space, so these + * directories will be found as new in perpetuity. + */ + DPRINTF(E_LOG, L_DB, "Directory name ends with space: [%s]\n", di->virtual_path); + } + query = sqlite3_mprintf(QADD_TMPL, di->virtual_path, di->db_timestamp, di->disabled, di->parent_id); if (!query)