version 1.49.2.2, 2005/05/28 14:03:25 |
version 1.49.2.3, 2005/07/12 11:33:40 |
Line 1550 filename_completion_function(const char |
|
Line 1550 filename_completion_function(const char |
|
char * |
char * |
username_completion_function(const char *text, int state) |
username_completion_function(const char *text, int state) |
{ |
{ |
struct passwd *pwd; |
struct passwd *pwd, pwres; |
|
char pwbuf[1024]; |
|
|
if (text[0] == '\0') |
if (text[0] == '\0') |
return (NULL); |
return (NULL); |
Line 1561 username_completion_function(const char |
|
Line 1562 username_completion_function(const char |
|
if (state == 0) |
if (state == 0) |
setpwent(); |
setpwent(); |
|
|
while ((pwd = getpwent()) && text[0] == pwd->pw_name[0] |
while (getpwent_r(&pwres, pwbuf, sizeof(pwbuf), &pwd) == 0 |
|
&& text[0] == pwd->pw_name[0] |
&& strcmp(text, pwd->pw_name) == 0); |
&& strcmp(text, pwd->pw_name) == 0); |
|
|
if (pwd == NULL) { |
if (pwd == NULL) { |