[FFmpeg-devel] avformat/utils.c fix mkdir always true

Submitted by darling.zhong on Nov. 8, 2019, 3:41 a.m.

Details

Message ID 75ccdacb.efed7.16e4919ec1e.Coremail.dalingzhong@yeah.net
State New
Headers show

Commit Message

darling.zhong Nov. 8, 2019, 3:41 a.m.
Signed-off-by: darling.zhong <dalingzhong@yeah.net>
---
 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 libavformat/utils.c

Comments

Andreas Rheinhardt Nov. 8, 2019, 12:07 p.m.
darling.zhong:
> Signed-off-by: darling.zhong <dalingzhong@yeah.net>
> ---
>  libavformat/utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>  mode change 100644 => 100755 libavformat/utils.c
> 
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> old mode 100644
> new mode 100755
> index 8196442dd1..0917cc81df
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -4869,7 +4869,7 @@ int ff_mkdir_p(const char *path)
>          }
>      }
>  
> -    if ((*(pos - 1) != '/') || (*(pos - 1) != '\\')) {
> +    if ((*(pos - 1) != '/') && (*(pos - 1) != '\\')) {
>          ret = mkdir(temp, 0755);
>      }
>  
> 
Already proposed here: [1] Feel free to address the concern raised by
Michael.

- Andreas

[1]: https://patchwork.ffmpeg.org/patch/15105/

Patch hide | download patch | download mbox

diff --git a/libavformat/utils.c b/libavformat/utils.c
old mode 100644
new mode 100755
index 8196442dd1..0917cc81df
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4869,7 +4869,7 @@  int ff_mkdir_p(const char *path)
         }
     }
 
-    if ((*(pos - 1) != '/') || (*(pos - 1) != '\\')) {
+    if ((*(pos - 1) != '/') && (*(pos - 1) != '\\')) {
         ret = mkdir(temp, 0755);
     }