[FFmpeg-devel] [PATCH v3 1/2] avformat/utils: simplify the code and remove av_strncasecmp

lance.lmwang at gmail.com lance.lmwang at gmail.com
Mon Dec 2 06:51:05 EET 2019


From: Limin Wang <lance.lmwang at gmail.com>

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavformat/utils.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8196442dd1..03a3705200 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4854,11 +4854,10 @@ int ff_mkdir_p(const char *path)
         return -1;
     }
 
-    if (!av_strncasecmp(temp, "/", 1) || !av_strncasecmp(temp, "\\", 1)) {
+    if (*temp == '/' || *temp == '\\')
         pos++;
-    } else if (!av_strncasecmp(temp, "./", 2) || !av_strncasecmp(temp, ".\\", 2)) {
+    else if (*temp == '.' && (*(temp+1) == '/' || *(temp+1) == '\\'))
         pos += 2;
-    }
 
     for ( ; *pos != '\0'; ++pos) {
         if (*pos == '/' || *pos == '\\') {
-- 
2.21.0



More information about the ffmpeg-devel mailing list