summaryrefslogtreecommitdiff
path: root/cmdedit.c
diff options
context:
space:
mode:
authorEric Andersen2001-01-27 06:01:43 +0000
committerEric Andersen2001-01-27 06:01:43 +0000
commitab050f5522e843bf08994685134adaaac7ffd392 (patch)
treee3f2fbeb43186bbe44fb58ba5a7f6a3c4843c1a5 /cmdedit.c
parent3654ca56fae6e3bdcb7369bc21d2b41d460ef732 (diff)
downloadbusybox-ab050f5522e843bf08994685134adaaac7ffd392.zip
busybox-ab050f5522e843bf08994685134adaaac7ffd392.tar.gz
Add in a patch to make busybox use the normal pwd.h and grp.h
functions. Add in simple implementations of these functions, which can, optionally, be used instead of the system versions. -Erik
Diffstat (limited to 'cmdedit.c')
-rw-r--r--cmdedit.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/cmdedit.c b/cmdedit.c
index c2b4123..e043d5f 100644
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -54,10 +54,6 @@
#include <sys/stat.h>
#endif
-#ifdef BB_FEATURE_USERNAME_COMPLETION
-#include <pwd.h>
-#endif
-
static const int MAX_HISTORY = 15; /* Maximum length of the linked list for the command line history */
enum {
@@ -354,10 +350,10 @@ static char** username_tab_completion(char *ud, int *num_matches)
char *temp;
int nm = 0;
- setpwent ();
+ bb_setpwent ();
userlen = strlen (ud + 1);
- while ((entry = getpwent ()) != NULL) {
+ while ((entry = bb_getpwent ()) != NULL) {
/* Null usernames should result in all users as possible completions. */
if (!userlen || !strncmp (ud + 1, entry->pw_name, userlen)) {
@@ -369,7 +365,7 @@ static char** username_tab_completion(char *ud, int *num_matches)
}
}
- endpwent ();
+ bb_endpwent ();
(*num_matches) = nm;
return (matches);
}