Permalink
Browse files

fix SMB issues on synology DSM 4.3

  • Loading branch information...
1 parent 5da316f commit 57c470408c8de49bf30d68498be52d4e0a275e22 tantric committed Nov 23, 2013
Showing with 61 additions and 66 deletions.
  1. +4 −0 changelog.txt
  2. +54 −63 source/fileop.cpp
  3. +1 −1 source/wiimc.h
  4. +2 −2 update.xml
View
@@ -6,6 +6,10 @@
�,�`���,��,�`���,�,�`���,��,�`���,�,�`���,��,�`���,�,�`���,��,�
+[1.3.4 - November 23, 2013]
+
+* SMB support for Synology DSM 4.3
+
[1.3.3 - March 31, 2013]
* Fixed YouTube (thanks jhb50!)
View
@@ -1703,57 +1703,49 @@ static bool ParseDirEntries()
if(entry == NULL)
break;
- if(strcmp(entry->d_name, "..") == 0)
+ if(strcmp(entry->d_name, "..") == 0 || entry->d_name[0] == '.' || entry->d_name[0] == '$')
{
- if(IsDeviceRoot(browser.dir))
- continue;
-
- filestat.st_mode = _IFDIR;
+ continue;
}
+
+ #ifdef _DIRENT_HAVE_D_TYPE
+ if(entry->d_type==DT_DIR)
+ filestat.st_mode = S_IFDIR;
else
+ filestat.st_mode = S_IFREG;
+
+ if(menuCurrent == MENU_BROWSE_PICTURES)
{
- if(entry->d_name[0] == '.' || entry->d_name[0] == '$')
- continue;
+ #endif
+ snprintf(path, MAXPATHLEN, "%s%s", browser.dir, entry->d_name);
- #ifdef _DIRENT_HAVE_D_TYPE
- if(entry->d_type==DT_DIR)
- filestat.st_mode = S_IFDIR;
- else
- filestat.st_mode = S_IFREG;
+ if(stat(path, &filestat) < 0)
+ continue;
+ #ifdef _DIRENT_HAVE_D_TYPE
+ }
+ #endif
- if(menuCurrent == MENU_BROWSE_PICTURES)
- {
- #endif
- snprintf(path, MAXPATHLEN, "%s%s", browser.dir, entry->d_name);
-
- if(stat(path, &filestat) < 0)
- continue;
- #ifdef _DIRENT_HAVE_D_TYPE
- }
- #endif
+ // skip this file if it's not an allowed extension
+ if(!S_ISDIR(filestat.st_mode))
+ {
+ GetExt(entry->d_name, ext);
- // skip this file if it's not an allowed extension
- if(!S_ISDIR(filestat.st_mode))
+ if(menuCurrent == MENU_BROWSE_VIDEOS && IsSubtitleExt(ext))
{
- GetExt(entry->d_name, ext);
-
- if(menuCurrent == MENU_BROWSE_VIDEOS && IsSubtitleExt(ext))
+ BROWSERENTRY *s_entry = AddEntrySubs();
+ if(s_entry)
+ s_entry->file = mem2_strdup(entry->d_name, MEM2_BROWSER);
+ if(!s_entry->file) // no mem
{
- BROWSERENTRY *s_entry = AddEntrySubs();
- if(s_entry)
- s_entry->file = mem2_strdup(entry->d_name, MEM2_BROWSER);
- if(!s_entry->file) // no mem
- {
- DeleteEntrySubs(s_entry);
- InfoPrompt("Warning", "This directory contains more entries than the maximum allowed. Not all entries will be visible.");
- entry = NULL;
- break;
- }
- }
-
- if(!IsAllowedExt(ext) && (!IsPlaylistExt(ext) || menuCurrent == MENU_BROWSE_PICTURES))
- continue;
+ DeleteEntrySubs(s_entry);
+ InfoPrompt("Warning", "This directory contains more entries than the maximum allowed. Not all entries will be visible.");
+ entry = NULL;
+ break;
+ }
}
+
+ if(!IsAllowedExt(ext) && (!IsPlaylistExt(ext) || menuCurrent == MENU_BROWSE_PICTURES))
+ continue;
}
// add the entry
@@ -1906,30 +1898,29 @@ ParseDirectory(bool waitParse)
if(dirHandle == NULL)
return -1;
- if(IsDeviceRoot(browser.dir))
- {
- BROWSERENTRY *f_entry = AddEntryFiles();
-
- if(!f_entry)
- return 0;
+ // add Up One Level
+ BROWSERENTRY *f_entry = AddEntryFiles();
+
+ if(!f_entry)
+ return 0;
- f_entry->file = mem2_strdup("..", MEM2_BROWSER);
- if(!f_entry->file) // no mem
- {
- DeleteEntryFiles(f_entry);
- return 0;
- }
- f_entry->display = mem2_strdup(gettext("Up One Level"), MEM2_BROWSER);
- if(!f_entry->display) // no mem
- {
- DeleteEntryFiles(f_entry);
- return 0;
- }
- f_entry->length = 0;
- f_entry->type = TYPE_FOLDER; // flag this as a dir
- f_entry->icon = ICON_FOLDER;
+ f_entry->file = mem2_strdup("..", MEM2_BROWSER);
+ if(!f_entry->file) // no mem
+ {
+ DeleteEntryFiles(f_entry);
+ return 0;
}
-
+ f_entry->display = mem2_strdup(gettext("Up One Level"), MEM2_BROWSER);
+ if(!f_entry->display) // no mem
+ {
+ DeleteEntryFiles(f_entry);
+ return 0;
+ }
+ f_entry->length = 0;
+ f_entry->type = TYPE_FOLDER; // flag this as a dir
+ f_entry->icon = ICON_FOLDER;
+
+ // start parsing
parseHalt = 0;
findLoadedFile = 1;
ParseDirEntries(); // index first 20 entries
View
@@ -12,7 +12,7 @@
#include "network.h"
#define APPNAME "WiiMC"
-#define APPVERSION "1.3.3"
+#define APPVERSION "1.3.4"
#define APPFOLDER "wiimc"
enum {
View
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<app version="1.3.3">
-<file url="http://wiimc.googlecode.com/files/WiiMC%201.3.3%20(Update).zip"></file>
+<app version="1.3.4">
+<file url="http://wiimc.googlecode.com/files/WiiMC%201.3.4%20(Update).zip"></file>
</app>

0 comments on commit 57c4704

Please sign in to comment.