[FFmpeg-devel] [PATCH v2 1/2] avformat/utils: simplify the code and remove av_strncasecmp
Hendrik Leppkes
h.leppkes at gmail.com
Sun Dec 1 18:32:04 EET 2019
On Sun, Dec 1, 2019 at 3:07 PM <lance.lmwang at gmail.com> wrote:
>
> From: Limin Wang <lance.lmwang at gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
> libavformat/utils.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 8196442..579e6d6 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 == '.')
> + pos++;
> + if (*temp == '/' || *temp == '\\')
> pos++;
> - } else if (!av_strncasecmp(temp, "./", 2) || !av_strncasecmp(temp, ".\\", 2)) {
> - pos += 2;
> - }
>
Is the change in logic intentional? It seems problematic to me to
potentially skip any dot, not just dots followed by a (back)slash.
Afterall names can start with dots.
- Hendrik
More information about the ffmpeg-devel
mailing list