[BACK]Return to complete.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.bin / ftp

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

Diff for /src/usr.bin/ftp/complete.c between version 1.11 and 1.12

version 1.11, 1997/09/13 09:05:53 version 1.12, 1998/05/20 00:53:57
Line 174  complete_local(word, list)
Line 174  complete_local(word, list)
         DIR *dd;          DIR *dd;
         struct dirent *dp;          struct dirent *dp;
         unsigned char rv;          unsigned char rv;
           size_t len;
   
         if ((file = strrchr(word, '/')) == NULL) {          if ((file = strrchr(word, '/')) == NULL) {
                 dir[0] = '.';                  dir[0] = '.';
Line 195  complete_local(word, list)
Line 196  complete_local(word, list)
   
         words = sl_init();          words = sl_init();
   
           len = strlen(file);
   
         for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {          for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
                 if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))                  if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
                         continue;                          continue;
                 if (strlen(file) > dp->d_namlen)  
   #ifndef __SVR4
                   if (len > dp->d_namlen)
                           continue;
   #else
                   if (len > strlen(dp->d_name))
                         continue;                          continue;
                 if (strncmp(file, dp->d_name, strlen(file)) == 0) {  #endif
                   if (strncmp(file, dp->d_name, len) == 0) {
                         char *tcp;                          char *tcp;
   
                         tcp = strdup(dp->d_name);                          tcp = strdup(dp->d_name);
Line 345  complete(el, ch)
Line 354  complete(el, ch)
   
                 /* check for 'continuation' completes (which are uppercase) */                  /* check for 'continuation' completes (which are uppercase) */
         if ((cursor_argc > celems) && (celems > 0)          if ((cursor_argc > celems) && (celems > 0)
             && isupper(c->c_complete[celems-1]))              && isupper((unsigned char) c->c_complete[celems-1]))
                 cursor_argc = celems;                  cursor_argc = celems;
   
         if (cursor_argc > celems)          if (cursor_argc > celems)

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

CVSweb <webmaster@jp.NetBSD.org>