chiark / gitweb /
Add detect-hardlinks.sh script
[termux-packages] / packages / mc / no_pwent_or_grent.patch
1 diff -u -r ../mc-4.8.11/lib/widget/input_complete.c ./lib/widget/input_complete.c
2 --- ../mc-4.8.11/lib/widget/input_complete.c    2013-11-29 19:27:07.000000000 +0100
3 +++ ./lib/widget/input_complete.c       2014-02-07 02:18:17.000000000 +0100
4 @@ -320,9 +320,12 @@
5          text++;
6      if (state == 0)
7      {                           /* Initialization stuff */
8 +#ifndef __ANDROID__
9          setpwent ();
10 +#endif
11          userlen = strlen (text + 1);
12      }
13 +#ifndef __ANDROID__
14      while ((entry = getpwent ()) != NULL)
15      {
16          /* Null usernames should result in all users as possible completions. */
17 @@ -331,6 +334,7 @@
18          if (text[1] == entry->pw_name[0] && !strncmp (text + 1, entry->pw_name, userlen))
19              break;
20      }
21 +#endif
22  
23      if (entry != NULL)
24          return g_strconcat ("~", entry->pw_name, PATH_SEP_STR, (char *) NULL);
25 diff -u -r ../mc-4.8.11/src/filemanager/achown.c ./src/filemanager/achown.c
26 --- ../mc-4.8.11/src/filemanager/achown.c       2013-11-29 19:27:07.000000000 +0100
27 +++ ./src/filemanager/achown.c  2014-02-07 02:17:29.000000000 +0100
28 @@ -346,19 +346,23 @@
29          if (is_owner)
30          {
31              /* get and put user names in the listbox */
32 +#ifndef __ANDROID__
33              setpwent ();
34              while ((chl_pass = getpwent ()) != NULL)
35                  listbox_add_item (chl_list, LISTBOX_APPEND_SORTED, 0, chl_pass->pw_name, NULL);
36              endpwent ();
37 +#endif
38              fe = listbox_search_text (chl_list, get_owner (sf_stat->st_uid));
39          }
40          else
41          {
42              /* get and put group names in the listbox */
43 +#ifndef __ANDROID__
44              setgrent ();
45              while ((chl_grp = getgrent ()) != NULL)
46                  listbox_add_item (chl_list, LISTBOX_APPEND_SORTED, 0, chl_grp->gr_name, NULL);
47              endgrent ();
48 +#endif
49              fe = listbox_search_text (chl_list, get_group (sf_stat->st_gid));
50          }
51  
52 diff -u -r ../mc-4.8.11/src/filemanager/chown.c ./src/filemanager/chown.c
53 --- ../mc-4.8.11/src/filemanager/chown.c        2013-11-29 19:27:07.000000000 +0100
54 +++ ./src/filemanager/chown.c   2014-02-07 02:17:11.000000000 +0100
55 @@ -221,10 +221,12 @@
56      /* add field for unknown names (numbers) */
57      listbox_add_item (l_user, LISTBOX_APPEND_AT_END, 0, _("<Unknown user>"), NULL);
58      /* get and put user names in the listbox */
59 +#ifndef __ANDROID__
60      setpwent ();
61      while ((l_pass = getpwent ()) != NULL)
62          listbox_add_item (l_user, LISTBOX_APPEND_SORTED, 0, l_pass->pw_name, NULL);
63      endpwent ();
64 +#endif
65  
66      add_widget (ch_dlg, groupbox_new (2, 4 + GW, GH, GW, _("Group name")));
67      l_group = listbox_new (3, 5 + GW, GH - 2, GW - 2, FALSE, NULL);
68 @@ -232,10 +234,12 @@
69      /* add field for unknown names (numbers) */
70      listbox_add_item (l_group, LISTBOX_APPEND_AT_END, 0, _("<Unknown group>"), NULL);
71      /* get and put group names in the listbox */
72 +#ifndef __ANDROID__
73      setgrent ();
74      while ((l_grp = getgrent ()) != NULL)
75          listbox_add_item (l_group, LISTBOX_APPEND_SORTED, 0, l_grp->gr_name, NULL);
76      endgrent ();
77 +#endif
78  
79      add_widget (ch_dlg, groupbox_new (2, 5 + GW * 2, GH, GW, _("File")));
80      /* add widgets for the file information */