[BACK]Return to readline.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libedit

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libedit/readline.c between version 1.51 and 1.52

version 1.51, 2005/04/12 22:01:40 version 1.52, 2005/04/19 03:29:18
Line 1378  history_search_pos(const char *str,
Line 1378  history_search_pos(const char *str,
 char *  char *
 tilde_expand(char *txt)  tilde_expand(char *txt)
 {  {
         struct passwd *pass;          struct passwd pwres, *pass;
         char *temp;          char *temp;
         size_t len = 0;          size_t len = 0;
           char pwbuf[1024];
   
         if (txt[0] != '~')          if (txt[0] != '~')
                 return (strdup(txt));                  return (strdup(txt));
Line 1398  tilde_expand(char *txt)
Line 1399  tilde_expand(char *txt)
                 (void)strncpy(temp, txt + 1, len - 2);                  (void)strncpy(temp, txt + 1, len - 2);
                 temp[len - 2] = '\0';                  temp[len - 2] = '\0';
         }          }
         pass = getpwnam(temp);          if (getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf), &pass) != 0)
                   pass = NULL;
         free(temp);             /* value no more needed */          free(temp);             /* value no more needed */
         if (pass == NULL)          if (pass == NULL)
                 return (strdup(txt));                  return (strdup(txt));
Line 1563  username_completion_function(const char 
Line 1565  username_completion_function(const char 
                 setpwent();                  setpwent();
   
         while (getpwent_r(&pwres, pwbuf, sizeof(pwbuf), &pwd) == 0          while (getpwent_r(&pwres, pwbuf, sizeof(pwbuf), &pwd) == 0
             && text[0] == pwd->pw_name[0]              && pwd != NULL && text[0] == pwd->pw_name[0]
             && strcmp(text, pwd->pw_name) == 0);              && strcmp(text, pwd->pw_name) == 0);
   
         if (pwd == NULL) {          if (pwd == NULL) {

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

CVSweb <webmaster@jp.NetBSD.org>