summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b>2005-10-09 11:08:54 +0000
committerLarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b>2005-10-09 11:08:54 +0000
commit50b840b9303ec0d6f74b3d4fb5ec355d133e0c97 (patch)
treee2f211f347142673efe7d9e0735c702fd4b33f48
parentc0e5840cbe5d9099d3f3a88b92c20d5100b91db2 (diff)
downloadvdr-plugin-muggle-50b840b9303ec0d6f74b3d4fb5ec355d133e0c97.tar.gz
vdr-plugin-muggle-50b840b9303ec0d6f74b3d4fb5ec355d133e0c97.tar.bz2
Correct a bug in samedir function
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@879 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r--Makefile8
-rw-r--r--mg_tools.c36
2 files changed, 23 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index 08cad1f..e334245 100644
--- a/Makefile
+++ b/Makefile
@@ -14,13 +14,13 @@ PLUGIN = muggle
#if you want ogg / flac support, define HAVE_VORBISFILE and/or HAVE_FLAC
#in $VDRDIR/Make.config like this:
-#HAVE_VORBISFILE=1
-#HAVE_FLAC=1
-#HAVE_SNDFILE=1
+HAVE_VORBISFILE=1
+HAVE_FLAC=1
+HAVE_SNDFILE=1
#if you do not want to compile in code for embedded mysql,
#define this:
-# HAVE_ONLY_SERVER=1
+HAVE_ONLY_SERVER=1
#define what database you want to use. Default is mysql. HAVE_SQLITE
#removes mysql support and adds SQLite support
diff --git a/mg_tools.c b/mg_tools.c
index 7b8a83c..6ad043b 100644
--- a/mg_tools.c
+++ b/mg_tools.c
@@ -103,22 +103,22 @@ std::string trim(std::string const& source, char const* delims ) {
char *
-SeparateFolders(const char *filename, char * folders[],unsigned int fcount)
+SeparateFolders(const char *filename, char * folders[], unsigned int fcount)
{
- for (unsigned int i=0;i<fcount;i++)
- folders[i]="";
- char *fbuf=strdup(filename);
- char *slash=fbuf-1;
- for (unsigned int i=0;i<fcount;i++)
- {
- char *p=slash+1;
- slash=strchr(p,'/');
- if (!slash)
- break;
- folders[i]=p;
- *slash=0;
- }
- return fbuf;
+ for (unsigned int i=0;i<fcount;i++)
+ folders[i]="";
+ char *fbuf=strdup(filename);
+ char *slash=fbuf-1;
+ for (unsigned int i=0;i<fcount;i++)
+ {
+ char *p=slash+1;
+ slash=strchr(p,'/');
+ if (!slash)
+ break;
+ folders[i]=p;
+ *slash=0;
+ }
+ return fbuf;
}
string&
@@ -185,7 +185,9 @@ bool samedir( const char *d1, const char *d2 )
#else
path_max = pathconf (path, _PC_PATH_MAX);
if (path_max <= 0)
- path_max = 4096;
+ {
+ path_max = 4096;
+ }
#endif
char rp1[path_max], rp2[path_max];
@@ -193,5 +195,5 @@ bool samedir( const char *d1, const char *d2 )
realpath(d1, rp1);
realpath(d2, rp2);
- return (!strcmp( d1, d2 ) );
+ return (!strcmp( rp1, rp2 ) );
}