aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/cmdedit.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index c2b4123db..e043d5f52 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -54,10 +54,6 @@
54#include <sys/stat.h> 54#include <sys/stat.h>
55#endif 55#endif
56 56
57#ifdef BB_FEATURE_USERNAME_COMPLETION
58#include <pwd.h>
59#endif
60
61static const int MAX_HISTORY = 15; /* Maximum length of the linked list for the command line history */ 57static const int MAX_HISTORY = 15; /* Maximum length of the linked list for the command line history */
62 58
63enum { 59enum {
@@ -354,10 +350,10 @@ static char** username_tab_completion(char *ud, int *num_matches)
354 char *temp; 350 char *temp;
355 int nm = 0; 351 int nm = 0;
356 352
357 setpwent (); 353 bb_setpwent ();
358 userlen = strlen (ud + 1); 354 userlen = strlen (ud + 1);
359 355
360 while ((entry = getpwent ()) != NULL) { 356 while ((entry = bb_getpwent ()) != NULL) {
361 /* Null usernames should result in all users as possible completions. */ 357 /* Null usernames should result in all users as possible completions. */
362 if (!userlen || !strncmp (ud + 1, entry->pw_name, userlen)) { 358 if (!userlen || !strncmp (ud + 1, entry->pw_name, userlen)) {
363 359
@@ -369,7 +365,7 @@ static char** username_tab_completion(char *ud, int *num_matches)
369 } 365 }
370 } 366 }
371 367
372 endpwent (); 368 bb_endpwent ();
373 (*num_matches) = nm; 369 (*num_matches) = nm;
374 return (matches); 370 return (matches);
375} 371}