[BACK]Return to echo.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/echo.c between version 1.4 and 1.5

version 1.4, 2001/01/29 01:58:07 version 1.5, 2001/05/03 12:57:22
Line 382 
Line 382 
                         lh = &(bheadp->b_list);                          lh = &(bheadp->b_list);
                 else if ((flags & EFFILE) != 0) {                  else if ((flags & EFFILE) != 0) {
                         buf[cpos] = '\0';                          buf[cpos] = '\0';
                         wholelist = lh = make_file_list(buf, 0);                          wholelist = lh = make_file_list(buf);
                 } else                  } else
                         panic("broken complt call: flags");                          panic("broken complt call: flags");
   
Line 394 
Line 394 
                 nhits = 0;                  nhits = 0;
                 nxtra = HUGE;                  nxtra = HUGE;
   
                 while (lh != NULL) {                  for (; lh != NULL; lh = lh->l_next) {
                         for (i = 0; i < cpos; ++i) {                          if (memcmp(buf, lh->l_name, cpos) != 0)
                                 if (buf[i] != lh->l_name[i])                                  continue;
                                         break;                          if (nhits == 0)
                                   lh2 = lh;
                           ++nhits;
                           if (lh->l_name[cpos] == '\0')
                                   nxtra = -1;
                           else {
                                   bxtra = getxtra(lh, lh2, cpos, wflag);
                                   if (bxtra < nxtra)
                                           nxtra = bxtra;
                                   lh2 = lh;
                         }                          }
                         if (i == cpos) {  
                                 if (nhits == 0)  
                                         lh2 = lh;  
                                 ++nhits;  
                                 if (lh->l_name[i] == '\0')  
                                         nxtra = -1;  
                                 else {  
                                         bxtra = getxtra(lh, lh2, cpos, wflag);  
                                         if (bxtra < nxtra)  
                                                 nxtra = bxtra;  
                                         lh2 = lh;  
                                 }  
                         }  
                         lh = lh->l_next;  
                 }                  }
                 if (nhits == 0)                  if (nhits == 0)
                         msg = " [No match]";                          msg = " [No match]";
Line 511 
Line 506 
                         wholelist = lh = complete_function_list(buf, c);                          wholelist = lh = complete_function_list(buf, c);
                 } else if ((flags & EFFILE) != 0) {                  } else if ((flags & EFFILE) != 0) {
                         buf[cpos] = '\0';                          buf[cpos] = '\0';
                         wholelist = lh = make_file_list(buf, 1);                          wholelist = lh = make_file_list(buf);
                         /*                          /*
                          * We don't want to display stuff up to the / for file                           * We don't want to display stuff up to the / for file
                          * names preflen is the list of a prefix of what the                           * names preflen is the list of a prefix of what the

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5