termux-packages/packages/mc/no_pwent_or_grent.patch

81 lines
3.1 KiB
Diff
Raw Normal View History

2015-06-13 01:03:31 +02:00
diff -u -r ../mc-4.8.11/lib/widget/input_complete.c ./lib/widget/input_complete.c
--- ../mc-4.8.11/lib/widget/input_complete.c 2013-11-29 19:27:07.000000000 +0100
+++ ./lib/widget/input_complete.c 2014-02-07 02:18:17.000000000 +0100
@@ -320,9 +320,12 @@
text++;
if (state == 0)
{ /* Initialization stuff */
+#ifndef __ANDROID__
setpwent ();
+#endif
userlen = strlen (text + 1);
}
+#ifndef __ANDROID__
while ((entry = getpwent ()) != NULL)
{
/* Null usernames should result in all users as possible completions. */
@@ -331,6 +334,7 @@
if (text[1] == entry->pw_name[0] && !strncmp (text + 1, entry->pw_name, userlen))
break;
}
+#endif
if (entry != NULL)
return g_strconcat ("~", entry->pw_name, PATH_SEP_STR, (char *) NULL);
diff -u -r ../mc-4.8.11/src/filemanager/achown.c ./src/filemanager/achown.c
--- ../mc-4.8.11/src/filemanager/achown.c 2013-11-29 19:27:07.000000000 +0100
+++ ./src/filemanager/achown.c 2014-02-07 02:17:29.000000000 +0100
@@ -346,19 +346,23 @@
if (is_owner)
{
/* get and put user names in the listbox */
+#ifndef __ANDROID__
setpwent ();
while ((chl_pass = getpwent ()) != NULL)
listbox_add_item (chl_list, LISTBOX_APPEND_SORTED, 0, chl_pass->pw_name, NULL);
endpwent ();
+#endif
fe = listbox_search_text (chl_list, get_owner (sf_stat->st_uid));
}
else
{
/* get and put group names in the listbox */
+#ifndef __ANDROID__
setgrent ();
while ((chl_grp = getgrent ()) != NULL)
listbox_add_item (chl_list, LISTBOX_APPEND_SORTED, 0, chl_grp->gr_name, NULL);
endgrent ();
+#endif
fe = listbox_search_text (chl_list, get_group (sf_stat->st_gid));
}
diff -u -r ../mc-4.8.11/src/filemanager/chown.c ./src/filemanager/chown.c
--- ../mc-4.8.11/src/filemanager/chown.c 2013-11-29 19:27:07.000000000 +0100
+++ ./src/filemanager/chown.c 2014-02-07 02:17:11.000000000 +0100
@@ -221,10 +221,12 @@
/* add field for unknown names (numbers) */
listbox_add_item (l_user, LISTBOX_APPEND_AT_END, 0, _("<Unknown user>"), NULL);
/* get and put user names in the listbox */
+#ifndef __ANDROID__
setpwent ();
while ((l_pass = getpwent ()) != NULL)
listbox_add_item (l_user, LISTBOX_APPEND_SORTED, 0, l_pass->pw_name, NULL);
endpwent ();
+#endif
add_widget (ch_dlg, groupbox_new (2, 4 + GW, GH, GW, _("Group name")));
l_group = listbox_new (3, 5 + GW, GH - 2, GW - 2, FALSE, NULL);
@@ -232,10 +234,12 @@
/* add field for unknown names (numbers) */
listbox_add_item (l_group, LISTBOX_APPEND_AT_END, 0, _("<Unknown group>"), NULL);
/* get and put group names in the listbox */
+#ifndef __ANDROID__
setgrent ();
while ((l_grp = getgrent ()) != NULL)
listbox_add_item (l_group, LISTBOX_APPEND_SORTED, 0, l_grp->gr_name, NULL);
endgrent ();
+#endif
add_widget (ch_dlg, groupbox_new (2, 5 + GW * 2, GH, GW, _("File")));
/* add widgets for the file information */