Patch 8.1.2084
Problem:    Amiga: cannot get the user name.
Solution:   Use getpwuid() if available. (Ola Söder, closes #4985)
Files:      src/os_amiga.c, src/os_amiga.h


*** ../vim-8.1.2083/src/os_amiga.c      2019-08-10 14:54:16.778279055 +0200
--- src/os_amiga.c      2019-09-27 13:38:31.022848939 +0200
***************
*** 664,670 ****
      int
  mch_get_user_name(char_u *s, int len)
  {
!     /* TODO: Implement this. */
      *s = NUL;
      return FAIL;
  }
--- 664,678 ----
      int
  mch_get_user_name(char_u *s, int len)
  {
! #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__)
!     struct passwd   *pwd = getpwuid(getuid());
! 
!     if (pwd != NULL && pwd->pw_name && len > 0)
!     {
!         vim_strncpy(s, (char_u *)pwd->pw_name, len - 1);
!         return OK;
!     }
! #endif
      *s = NUL;
      return FAIL;
  }
*** ../vim-8.1.2083/src/os_amiga.h      2019-07-03 22:53:03.579656609 +0200
--- src/os_amiga.h      2019-09-27 13:36:14.407446491 +0200
***************
*** 90,95 ****
--- 90,96 ----
  # include <unistd.h>
  # include <limits.h>
  # include <errno.h>
+ # include <pwd.h>
  # include <dirent.h>
  #endif
  
*** ../vim-8.1.2083/src/version.c       2019-09-27 13:32:03.068515072 +0200
--- src/version.c       2019-09-27 13:37:25.359137375 +0200
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     2084,
  /**/

-- 
We do not stumble over mountains, but over molehills.
                                Confucius

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/201909271139.x8RBdWgA017755%40masaka.moolenaar.net.

Raspunde prin e-mail lui