aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Plate <elupus@ecce.se>2011-10-27 12:05:43 -0700
committerJoakim Plate <elupus@ecce.se>2011-10-27 12:05:43 -0700
commit1e015aa0e97628c7fa91fc5b4bf7dd4d51ce6e9c (patch)
tree9509ad1a5e2f8ddf2a11cdbb82fa835d2bbdd1c1
parentb9a8736cd9229c138e511ad70df939c10156c184 (diff)
parent64ef2fb0227b2066768a0a8881e751cb542f66a0 (diff)
Merge pull request #513 from koying/master
Fixes for Video cleaning & Curl invalid api usage
-rw-r--r--xbmc/filesystem/FileCurl.cpp6
-rw-r--r--xbmc/video/VideoDatabase.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/xbmc/filesystem/FileCurl.cpp b/xbmc/filesystem/FileCurl.cpp
index cce444917a..58cf1bf0c8 100644
--- a/xbmc/filesystem/FileCurl.cpp
+++ b/xbmc/filesystem/FileCurl.cpp
@@ -1135,8 +1135,8 @@ int CFileCurl::Stat(const CURL& url, struct __stat64* buffer)
if(buffer)
{
- char content[255];
- if (CURLE_OK != g_curlInterface.easy_getinfo(m_state->m_easyHandle, CURLINFO_CONTENT_TYPE, content))
+ char *content;
+ if (CURLE_OK != g_curlInterface.easy_getinfo(m_state->m_easyHandle, CURLINFO_CONTENT_TYPE, &content))
{
g_curlInterface.easy_release(&m_state->m_easyHandle, NULL);
errno = ENOENT;
@@ -1146,7 +1146,7 @@ int CFileCurl::Stat(const CURL& url, struct __stat64* buffer)
{
memset(buffer, 0, sizeof(struct __stat64));
buffer->st_size = (int64_t)length;
- if(strstr(content, "text/html")) //consider html files directories
+ if(content && strstr(content, "text/html")) //consider html files directories
buffer->st_mode = _S_IFDIR;
else
buffer->st_mode = _S_IFREG;
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
index ff08adae09..16c7e66e74 100644
--- a/xbmc/video/VideoDatabase.cpp
+++ b/xbmc/video/VideoDatabase.cpp
@@ -6645,8 +6645,8 @@ void CVideoDatabase::CleanDatabase(IVideoInfoScannerObserver* pObserver, const v
m_pDS->exec(sql.c_str());
}
- CLog::Log(LOGDEBUG, "%s: Cleaning paths that don't exist and don't have content set...", __FUNCTION__);
- sql = "select * from path where strContent not like ''";
+ CLog::Log(LOGDEBUG, "%s: Cleaning paths that don't exist and have content set...", __FUNCTION__);
+ sql = "select * from path where strContent != ''";
m_pDS->query(sql.c_str());
CStdString strIds;
while (!m_pDS->eof())