[vlc-commits] hds: use strcasestr() for ASCII case-insentive match

Rémi Denis-Courmont git at videolan.org
Sat May 9 10:53:50 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat May  9 10:27:36 2015 +0300| [1451c61c0c3ee5ce6263747532c90606e94d31ac] | committer: Rémi Denis-Courmont

hds: use strcasestr() for ASCII case-insentive match

vlc_strcasestr() is slower, locale-dependant and wrong
(e.g. httpś should not match).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1451c61c0c3ee5ce6263747532c90606e94d31ac
---

 modules/stream_filter/hds/hds.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/hds/hds.c b/modules/stream_filter/hds/hds.c
index 235921e..c7acd92 100644
--- a/modules/stream_filter/hds/hds.c
+++ b/modules/stream_filter/hds/hds.c
@@ -223,8 +223,8 @@ static int   Control( stream_t *, int , va_list );
 
 static inline bool isFQUrl( const char* url )
 {
-    return ( NULL != vlc_strcasestr( url, "https://") ||
-             NULL != vlc_strcasestr( url, "http://" ) );
+    return ( NULL != strcasestr( url, "https://") ||
+             NULL != strcasestr( url, "http://" ) );
 }
 
 static bool isHDS( stream_t *s )



More information about the vlc-commits mailing list