summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <triad@df.lth.se>2009-01-10 22:15:57 +0000
committerLinus Walleij <triad@df.lth.se>2009-01-10 22:15:57 +0000
commita0e863b06c497b6d8e48072a65ecd9589a156b56 (patch)
treea857183802af61f2b04bde5a213adb2eb743db55
parent5b4a4d2b78e61715937b26c0bab9e901d891c937 (diff)
downloadlibmtp-a0e863b06c497b6d8e48072a65ecd9589a156b56.tar.gz
Replace rindex with strrchr
-rw-r--r--ChangeLog2
-rw-r--r--src/libmtp.c10
2 files changed, 4 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a94081..f267fe9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
2009-01-10 Linus Walleij <triad@df.lth.se>
* src/libmtp.h.in: mingw32 fixes from James Ravenscroft.
- * src/libmtp.c: dito.
+ * src/libmtp.c: dito. Replaced "rindex" with "strrchr"
* src/Makefile.am: dito.
* examples/albumart.c: dito.
diff --git a/src/libmtp.c b/src/libmtp.c
index 077330a..df65c67 100644
--- a/src/libmtp.c
+++ b/src/libmtp.c
@@ -54,10 +54,6 @@
#define USE_WINDOWS_IO_H
#include <io.h>
#endif
-#ifdef __WIN32__
-/* Windows does not have rindex */
-#define rindex strrchr
-#endif
/* To enable PTP level debug prints (all ptp_debug(...)), switch on this */
//#define ENABLE_PTP_DEBUG
@@ -2998,7 +2994,7 @@ LIBMTP_file_t *LIBMTP_Get_Filelisting_With_Callback(LIBMTP_mtpdevice_t *device,
// Repair forgotten OGG filetype
char *ptype;
- ptype = rindex(file->filename,'.')+1;
+ ptype = strrchr(file->filename,'.')+1;
if (ptype != NULL && !strcasecmp (ptype, "ogg")) {
// Fix it.
file->filetype = LIBMTP_FILETYPE_OGG;
@@ -3684,7 +3680,7 @@ LIBMTP_track_t *LIBMTP_Get_Tracklisting_With_Callback(LIBMTP_mtpdevice_t *device
// Repair forgotten OGG filetype
char *ptype;
- ptype = rindex(track->filename,'.')+1;
+ ptype = strrchr(track->filename,'.')+1;
if (ptype != NULL && !strcasecmp (ptype, "ogg")) {
// Fix it.
track->filetype = LIBMTP_FILETYPE_OGG;
@@ -3791,7 +3787,7 @@ LIBMTP_track_t *LIBMTP_Get_Trackmetadata(LIBMTP_mtpdevice_t *device, uint32_t co
// Repair forgotten OGG filetype
char *ptype;
- ptype = rindex(track->filename,'.')+1;
+ ptype = strrchr(track->filename,'.')+1;
if (ptype != NULL && !strcasecmp (ptype, "ogg")) {
// Fix it.
track->filetype = LIBMTP_FILETYPE_OGG;