To: vim_dev@googlegroups.com Subject: Patch 8.1.2084 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 # include # include + # include # include #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 -- Bram@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 ///