Patch 8.2.4340
Problem:    Amiga: mch_can_exe() is not implemented.
Solution:   Implement mch_can_exe() for Amiga OS 4. (Ola Söder, closes #9731)
Files:      src/os_amiga.c


*** ../vim-8.2.4339/src/os_amiga.c      2022-01-02 19:25:22.850078488 +0000
--- src/os_amiga.c      2022-02-10 19:58:21.968641177 +0000
***************
*** 891,898 ****
      int
  mch_can_exe(char_u *name, char_u **path, int use_path)
  {
!     // TODO
!     return -1;
  }
  
  /*
--- 891,938 ----
      int
  mch_can_exe(char_u *name, char_u **path, int use_path)
  {
!     int exe = -1;
! #ifdef __amigaos4__
!     // Load file sections using elf.library or hunk.library.
!     BPTR seg = LoadSeg(name);
! 
!     if (seg && GetSegListInfoTags(seg, GSLI_Native, NULL, TAG_DONE) !=
!         GetSegListInfoTags(seg, GSLI_68KHUNK, NULL, TAG_DONE))
!     {
!         // Test if file permissions allow execution.
!         struct ExamineData *exd = ExamineObjectTags(EX_StringNameInput, name);
! 
!         exe = (exd && !(exd->Protection & EXDF_NO_EXECUTE)) ? 1 : 0;
!         FreeDosObject(DOS_EXAMINEDATA, exd);
!     }
!     else
!     {
!         exe = 0;
!     }
! 
!     UnLoadSeg(seg);
! 
!     // Search for executable in path if applicable.
!     if (!exe && use_path)
!     {
!         // Save current working dir.
!         BPTR cwd = GetCurrentDir();
!         struct PathNode *head = DupCmdPathList(NULL);
! 
!         // For each entry, recur to check for executable.
!         for(struct PathNode *tail = head; !exe && tail;
!             tail = (struct PathNode *) BADDR(tail->pn_Next))
!         {
!             SetCurrentDir(tail->pn_Lock);
!             exe = mch_can_exe(name, path, 0);
!         }
! 
!         // Go back to where we were.
!         FreeCmdPathList(head);
!         SetCurrentDir(cwd);
!     }
! #endif
!     return exe;
  }
  
  /*
*** ../vim-8.2.4339/src/version.c       2022-02-10 19:51:42.549569899 +0000
--- src/version.c       2022-02-10 19:59:44.940469864 +0000
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     4340,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
15. Five days in advance, tell your friends you can't attend their
    party because you're not in the mood.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220210202140.9490A1C12B8%40moolenaar.net.

Raspunde prin e-mail lui