diff options
| author | LarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b> | 2005-10-09 11:08:54 +0000 |
|---|---|---|
| committer | LarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b> | 2005-10-09 11:08:54 +0000 |
| commit | 50b840b9303ec0d6f74b3d4fb5ec355d133e0c97 (patch) | |
| tree | e2f211f347142673efe7d9e0735c702fd4b33f48 | |
| parent | c0e5840cbe5d9099d3f3a88b92c20d5100b91db2 (diff) | |
| download | vdr-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-- | Makefile | 8 | ||||
| -rw-r--r-- | mg_tools.c | 36 |
2 files changed, 23 insertions, 21 deletions
@@ -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 @@ -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 ) ); } |
