stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2261332969b6e97aa302ee1663b3626c7378d9ad

commit 2261332969b6e97aa302ee1663b3626c7378d9ad
Author: Vincent Torri <vincent.to...@gmail.com>
Date:   Mon Aug 31 13:46:51 2020 +0000

    ecore_file_can_exec: fix .bat case
    
    the test on the .bat file was too early
    
    Reviewed-by: João Paulo Taylor Ienczak Zanette 
<joao....@expertisesolutions.com.br>
    Reviewed-by: Stefan Schmidt <ste...@datenfreihafen.org>
    Differential Revision: https://phab.enlightenment.org/D12122
---
 src/lib/ecore_file/ecore_file.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c
index 528de6a97a..83fca2600e 100644
--- a/src/lib/ecore_file/ecore_file.c
+++ b/src/lib/ecore_file/ecore_file.c
@@ -643,7 +643,7 @@ ecore_file_can_exec(const char *file)
    h = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, NULL,
                   OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
    if (h == INVALID_HANDLE_VALUE)
-     return EINA_FALSE;
+     goto test_bat;
 
    if (!GetFileSizeEx(h, &sz))
      goto close_h;
@@ -697,16 +697,16 @@ ecore_file_can_exec(const char *file)
     */
    if ((characteristics & 0x0002) && !(characteristics & 0x2000))
      return EINA_TRUE;
-
+ unmap_view:
+   UnmapViewOfFile(base);
+ close_h:
+   CloseHandle(h);
+ test_bat:
    /*
     * a .bat file, considered as an executable, is only a text file,
     * so we rely on the extension. Not the best but we cannot do more.
     */
    return eina_str_has_extension(file, ".bat");
- unmap_view:
-   UnmapViewOfFile(base);
- close_h:
-   CloseHandle(h);
 #else
    if (!access(file, X_OK)) return EINA_TRUE;
 #endif

-- 


Reply via email to