avutil/avstring: Fix warning: ISO C90 forbids mixed declarations and code
authorLimin Wang <lance.lmwang@gmail.com>
Mon, 13 Jan 2020 13:44:49 +0000 (21:44 +0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 14 Jan 2020 18:19:30 +0000 (19:19 +0100)
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavutil/avstring.c

index 76a13ba..f4b8ed2 100644 (file)
@@ -258,15 +258,17 @@ char *av_strireplace(const char *str, const char *from, const char *to)
 const char *av_basename(const char *path)
 {
     char *p;
+#if HAVE_DOS_PATHS
+    char *q, *d;
+#endif
 
     if (!path || *path == '\0')
         return ".";
 
     p = strrchr(path, '/');
 #if HAVE_DOS_PATHS
-    char *q = strrchr(path, '\\');
-    char *d = strchr(path, ':');
-
+    q = strrchr(path, '\\');
+    d = strchr(path, ':');
     p = FFMAX3(p, q, d);
 #endif