aboutsummaryrefslogtreecommitdiffstats
path: root/src/ls.c
diff options
context:
space:
mode:
authorQball Cow <qball@qballcow.nl>2005-09-08 21:08:02 +0000
committerQball Cow <qball@qballcow.nl>2005-09-08 21:08:02 +0000
commitedcfbef90da5f3a6abf60559042d61d0f3d765d7 (patch)
treecd84b4a7b53e2ee90588a57bc581c34390b9dadd /src/ls.c
parentbc666a9fc6dbd25bc9fd8cfe20d46bab9582682b (diff)
downloadmpd-edcfbef90da5f3a6abf60559042d61d0f3d765d7.tar.gz
mpd-edcfbef90da5f3a6abf60559042d61d0f3d765d7.tar.xz
mpd-edcfbef90da5f3a6abf60559042d61d0f3d765d7.zip
Patch to make the configure flag for mpd-mad and mpd-libid3tag more logic (from ticho)
git-svn-id: https://svn.musicpd.org/mpd/trunk@3477 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/ls.c b/src/ls.c
index 1220d370c..9cdf4bb66 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -30,6 +30,8 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <errno.h>
+extern int errno;
char * dupAndStripPlaylistSuffix(char * file) {
size_t size = strlen(file)-strlen(PLAYLIST_FILE_SUFFIX)-1;
@@ -210,7 +212,14 @@ int isFile(char * utf8file, time_t * mtime) {
if(mtime) *mtime = st.st_mtime;
return 1;
}
- else return 0;
+ else
+ {
+ DEBUG("isFile: %s is not a regular file\n",utf8file);
+ return 0;
+ }
+ }
+ else {
+ DEBUG("isFile: failed to stat: %s: %s\n", utf8file, strerror(errno));
}
return 0;
@@ -257,15 +266,24 @@ InputPlugin * hasMusicSuffix(char * utf8file) {
InputPlugin * ret = NULL;
char * s = getSuffix(utf8file);
- if(s) ret = getInputPluginFromSuffix(s);
+ if(s) {
+ ret = getInputPluginFromSuffix(s);
+ }
+ else {
+ DEBUG("hasMusicSuffix: The file: %s has no valid suffix\n",utf8file);
+ }
return ret;
}
InputPlugin * isMusic(char * utf8file, time_t * mtime) {
if(isFile(utf8file,mtime)) {
- return hasMusicSuffix(utf8file);
+ InputPlugin *plugin = hasMusicSuffix(utf8file);
+ if (plugin == NULL) {
+ DEBUG("isMusic: %s is not a supported music file\n");
+ }
+ return plugin;
}
-
+ DEBUG("isMusic: %s is not a valid file\n",utf8file);
return NULL;
}