aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-03-10 02:58:27 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-03-10 02:58:27 +0000
commitc69b615f2b17a927f2c49ab9cd381eb1e5a8e2a4 (patch)
tree2a3436d5ad006470faa473478d585acad70ee2b7 /src/directory.c
parentec234e985563316d725c7a8b8873f2c34e4d4635 (diff)
downloadmpd-c69b615f2b17a927f2c49ab9cd381eb1e5a8e2a4.tar.gz
mpd-c69b615f2b17a927f2c49ab9cd381eb1e5a8e2a4.tar.xz
mpd-c69b615f2b17a927f2c49ab9cd381eb1e5a8e2a4.zip
fix it so that mpd will work if mtime is 0 (for those strange folk)
git-svn-id: https://svn.musicpd.org/mpd/trunk@237 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/directory.c')
-rw-r--r--src/directory.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/directory.c b/src/directory.c
index 457a5d585..f8bd00969 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -90,7 +90,7 @@ Directory * newDirectory(Directory * parentDirectory, char * dirname, time_t mti
directory->parentDirectory = parentDirectory;
directory->subDirectories = newDirectoryList();
directory->songs = newSongList();
- if(mtime<0) directory->mtime = isDir(dirname);
+ if(mtime<0) isDir(dirname,&(directory->mtime));
else directory->mtime = mtime;
return directory;
@@ -147,7 +147,7 @@ int updateInDirectory(Directory * directory, char * shortname, char * name) {
void * song;
void * subDir;
- if((mtime = isMusic(name))) {
+ if(isMusic(name,&mtime)) {
if(0==findInList(directory->songs,shortname,&song)) {
addToDirectory(directory,shortname,name);
}
@@ -156,7 +156,7 @@ int updateInDirectory(Directory * directory, char * shortname, char * name) {
updateSongInfo((Song *)song);
}
}
- else if((mtime = isDir(name))) {
+ else if(isDir(name,&mtime)) {
if(findInList(directory->subDirectories,shortname,(void **)&subDir)) {
updateDirectory((Directory *)subDir);
}
@@ -204,7 +204,7 @@ int removeDeletedFromDirectory(Directory * directory) {
while(node) {
tmpNode = node->nextNode;
if(findInList(entList,node->key,&name)) {
- if(!isDir((char *)name)) {
+ if(!isDir((char *)name,NULL)) {
LOG("removing directory: %s\n",(char*)name);
deleteFromList(directory->subDirectories,node->key);
}
@@ -220,7 +220,7 @@ int removeDeletedFromDirectory(Directory * directory) {
while(node) {
tmpNode = node->nextNode;
if(findInList(entList,node->key,(void **)&name)) {
- if(!isMusic(name)) {
+ if(!isMusic(name,NULL)) {
removeSongFromDirectory(directory,node->key);
}
}
@@ -268,7 +268,7 @@ int updateDirectory(Directory * directory) {
closedir(dir);
- if(directory->utf8name) directory->mtime = isDir(directory->utf8name);
+ if(directory->utf8name) isDir(directory->utf8name,&(directory->mtime));
return 0;
}
@@ -323,10 +323,10 @@ int addSubDirectoryToDirectory(Directory * directory, char * shortname,
}
int addToDirectory(Directory * directory, char * shortname, char * name) {
- if(isDir(name)) {
+ if(isDir(name,NULL)) {
return addSubDirectoryToDirectory(directory,shortname,name);
}
- else if(isMusic(name)) {
+ else if(isMusic(name,NULL)) {
Song * song;
song = addSongToList(directory->songs,shortname,name);
if(!song) return -1;