Patch 8.1.2084

9 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 27, 2019, 7:39:41 AM9/27/19
to vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- 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 ///
Reply all
Reply to author
Forward
0 new messages