[vim/vim] Topic/amiga get user name (#4985)

28 views
Skip to first unread message

Ola Söder

unread,
Sep 26, 2019, 4:49:40 PM9/26/19
to vim/vim, Subscribed

Since getuid() and getpwuid() exist on NG systems we might as well use them.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/4985

Commit Summary

  • Merge pull request #1 from vim/master
  • Merge pull request #2 from vim/master
  • Merge remote-tracking branch 'upstream/master'
  • Merge remote-tracking branch 'upstream/master'
  • Merge remote-tracking branch 'upstream/master'
  • Merge remote-tracking branch 'upstream/master'
  • Merge remote-tracking branch 'upstream/master'
  • Problem: Amiga: Not possible to get user name.

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Ola Söder

unread,
Sep 26, 2019, 5:24:05 PM9/26/19
to vim/vim, Push

@sodero pushed 1 commit.

  • 228298c Problem: Amiga: Not possible to get user name.


You are receiving this because you are subscribed to this thread.

View it on GitHub

Codecov

unread,
Sep 26, 2019, 5:24:07 PM9/26/19
to vim/vim, Subscribed

Codecov Report

Merging #4985 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@

##           master    #4985      +/-   ##

==========================================

+ Coverage   81.72%   81.75%   +0.02%     

==========================================

  Files         131      131              

  Lines      146540   146540              

==========================================

+ Hits       119761   119797      +36     

+ Misses      26779    26743      -36
Impacted Files Coverage Δ
src/terminal.c 81.89% <0%> (-0.04%) ⬇️
src/os_unix.c 63.5% <0%> (+0.04%) ⬆️
src/message.c 79.52% <0%> (+0.05%) ⬆️
src/gui_gtk_x11.c 58.21% <0%> (+0.09%) ⬆️
src/sign.c 94.59% <0%> (+0.18%) ⬆️
src/netbeans.c 27.46% <0%> (+0.22%) ⬆️
src/profiler.c 94.67% <0%> (+0.56%) ⬆️
src/gui.c 64.32% <0%> (+0.61%) ⬆️
src/ui.c 70.32% <0%> (+1.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2c1fb4...91328a8. Read the comment docs.


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or mute the thread.

Yegappan Lakshmanan

unread,
Sep 26, 2019, 6:29:20 PM9/26/19
to Ola Söder, Subscribed, vim_dev
Hi,

On Thu, Sep 26, 2019 at 1:49 PM Ola Söder <vim-dev...@256bit.org> wrote:
>
> Since getuid() and getpwuid() exist on NG systems we might as well use them.
>

It looks like you are building Vim on Amiga. Recently many refactoring
changes were made to the Vim sources. I couldn't verify these changes
on an Amiga platform (as i don't have access to one). Are you able to
build the different Vim variants (tiny, normal, huge) on Amiga successfully
with the latest sources?

Thanks,
Yegappan

K.Takata

unread,
Sep 26, 2019, 11:52:13 PM9/26/19
to vim/vim, Subscribed

@yegappan's comment is not forwarded here.
https://groups.google.com/d/msg/vim_dev/Y9Ir9BWdIMU/YZ54udMoBQAJ

It looks like you are building Vim on Amiga. Recently many refactoring
changes were made to the Vim sources. I couldn't verify these changes
on an Amiga platform (as i don't have access to one). Are you able to
build the different Vim variants (tiny, normal, huge) on Amiga successfully
with the latest sources?

Dominique Pellé

unread,
Sep 27, 2019, 1:25:06 AM9/27/19
to vim/vim, Subscribed

@dpelle commented on this pull request.


In src/os_amiga.c:

> @@ -664,9 +664,20 @@ mch_can_restore_icon(void)

     int

 mch_get_user_name(char_u *s, int len)

 {

+#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__)

+    int uid = getuid();

+    struct passwd *pwd = getpwuid(uid);

+

+    if (pwd && pwd->pw_name && len > 0)

+    {

+        vim_strncpy(s, (char_u *) pwd->pw_name, len - 1);

+        return OK;

+    }

The function has no return statement if the condition at line 671 is false (→ undefined behavior).


You are receiving this because you are subscribed to this thread.

Ola Söder

unread,
Sep 27, 2019, 2:23:18 AM9/27/19
to vim/vim, Push

@sodero pushed 1 commit.

  • 57b9a24 Problem: Amiga: Not possible to get user name.


You are receiving this because you are subscribed to this thread.

View it on GitHub

Ola Söder

unread,
Sep 27, 2019, 2:24:01 AM9/27/19
to vim/vim, Subscribed

@sodero commented on this pull request.


In src/os_amiga.c:

> @@ -664,9 +664,20 @@ mch_can_restore_icon(void)
     int
 mch_get_user_name(char_u *s, int len)
 {
+#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__)
+    int uid = getuid();
+    struct passwd *pwd = getpwuid(uid);
+
+    if (pwd && pwd->pw_name && len > 0)
+    {
+        vim_strncpy(s, (char_u *) pwd->pw_name, len - 1);
+        return OK;
+    }

Silly misstake. Fixed it now.

rolfkopman

unread,
Sep 27, 2019, 2:30:30 AM9/27/19
to vim_dev
I haven't tried that tiny and normal, I always build huge + a MUI gui which is not part of the upstream Vim.


And the code is here: https://github.com/sodero/MUI-Vim

I'll look into tiny and normal during the weekend if I can manage to allocate some time.

Br,
Ola

Bram Moolenaar

unread,
Sep 27, 2019, 7:39:27 AM9/27/19
to vim/vim, Subscribed

Closed #4985 via 5e8e967.

rolfkopman

unread,
Sep 27, 2019, 4:05:48 PM9/27/19
to vim_dev
Hi!


On Friday, September 27, 2019 at 12:29:20 AM UTC+2, yega...@gmail.com wrote:
Yes, tiny, small, normal, big and huge all work on Amiga.

Br,
Ola

 

Thanks,
Yegappan

Yegappan Lakshmanan

unread,
Sep 27, 2019, 8:48:00 PM9/27/19
to vim_dev
Hi,

On Fri, Sep 27, 2019 at 1:05 PM rolfkopman <rolfk...@gmail.com> wrote:
>
>>
>> It looks like you are building Vim on Amiga. Recently many refactoring
>> changes were made to the Vim sources. I couldn't verify these changes
>> on an Amiga platform (as i don't have access to one). Are you able to
>> build the different Vim variants (tiny, normal, huge) on Amiga successfully
>> with the latest sources?
>
>
> Yes, tiny, small, normal, big and huge all work on Amiga.
>

Thanks for verifying the different Vim builds on Amiga.

Regards,
Yegappan
Reply all
Reply to author
Forward
0 new messages