From 4eb9b40db997ea5935854185cbe0f866c68c34a5 Mon Sep 17 00:00:00 2001 From: xan1242 <8014093+xan1242@users.noreply.github.com> Date: Mon, 22 Aug 2022 03:20:41 +0200 Subject: [PATCH] [Tag] add unix path separator --- XNFSMusicPlayer/XNFSMusicPlayer.h | 2 +- XNFSMusicPlayer/XNFSMusicPlayer_TagReader.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/XNFSMusicPlayer/XNFSMusicPlayer.h b/XNFSMusicPlayer/XNFSMusicPlayer.h index 34a3ab2..936049d 100644 --- a/XNFSMusicPlayer/XNFSMusicPlayer.h +++ b/XNFSMusicPlayer/XNFSMusicPlayer.h @@ -19,7 +19,7 @@ // TODO - implement proper versioning #define BUILD_VER_MAJOR 1 -#define BUILD_VER_MINOR 11 +#define BUILD_VER_MINOR 12 #define FILE_TYPE_TRACKER 1 #define FILE_TYPE_STREAM 2 diff --git a/XNFSMusicPlayer/XNFSMusicPlayer_TagReader.h b/XNFSMusicPlayer/XNFSMusicPlayer_TagReader.h index a6be1aa..6be3689 100644 --- a/XNFSMusicPlayer/XNFSMusicPlayer_TagReader.h +++ b/XNFSMusicPlayer/XNFSMusicPlayer_TagReader.h @@ -23,6 +23,8 @@ void ReadFilenameAsTrackName(const char* FilePath, int TrackNumber, JukeboxTrack memset(JukeStuff, 0, 255); pch1 = strrchr(FilePath, '\\'); + if (pch1 == NULL) + pch1 = strrchr(FilePath, '/'); pch2 = strrchr(FilePath, '.'); if (pch1 == NULL) @@ -42,6 +44,8 @@ void ReadLastFolderAsAlbum(const char* FilePath, int TrackNumber, JukeboxTrack* const char *pch3; pch1 = strrchr(FilePath, '\\'); + if (pch1 == NULL) + pch1 = strrchr(FilePath, '/'); pch2 = strrchr(FilePath, '.'); memset(JukeStuff, 0, 255); @@ -53,6 +57,8 @@ void ReadLastFolderAsAlbum(const char* FilePath, int TrackNumber, JukeboxTrack* memset(Buffer2, 0, 255); strncpy(Buffer2, FilePath, pch1 - FilePath); pch3 = strrchr(Buffer2, '\\'); + if (pch3 == NULL) + pch3 = strrchr(Buffer2, '/'); if (pch3 == NULL) { strncpy(JukeStuff, FilePath, pch1 - FilePath);