[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.12 and 1.13

version 1.12, 2000/12/23 22:02:20 version 1.13, 2000/12/31 09:50:32
Line 1351  _rl_qsort_string_compare(i1, i2)
Line 1351  _rl_qsort_string_compare(i1, i2)
         const void *i1, *i2;          const void *i1, *i2;
 {  {
         const char *s1 = ((const char **)i1)[0];          const char *s1 = ((const char **)i1)[0];
         const char *s2 = ((const char **)i1)[0];          const char *s2 = ((const char **)i2)[0];
   
         return strcasecmp(s1, s2);          return strcasecmp(s1, s2);
 }  }
Line 1369  rl_display_match_list (matches, len, max
Line 1369  rl_display_match_list (matches, len, max
         int i, idx, limit, count;          int i, idx, limit, count;
         int screenwidth = e->el_term.t_size.h;          int screenwidth = e->el_term.t_size.h;
   
         max += 2;       /* space between entries */          /*
            * Find out how many entries can be put on one line, count
         /* find out how many entries can be put on one line */           * with two spaces between strings.
         limit = screenwidth / max;           */
           limit = screenwidth / (max + 2);
         if (limit == 0)          if (limit == 0)
                 limit = 1;                  limit = 1;
   
         /* how many lines of output */          /* how many lines of output */
         count = len / limit;          count = len / limit;
           if (count * limit < len)
                   count++;
   
         /* Sort the items if they are not already sorted. */          /* Sort the items if they are not already sorted. */
         qsort(matches + 1, len, sizeof(char *), _rl_qsort_string_compare);          qsort(&matches[1], len-1, sizeof(char *), _rl_qsort_string_compare);
   
         idx = 1;          idx = 1;
         for(; count >= 0; count--) {          for(; count > 0; count--) {
                 for(i=0; i < limit && matches[idx]; i++, idx++)                  for(i=0; i < limit && matches[idx]; i++, idx++)
                         fprintf(e->el_outfile, "%s  ", matches[idx]);                          fprintf(e->el_outfile, "%-*s  ", max, matches[idx]);
                 fprintf(e->el_outfile, "\n");                  fprintf(e->el_outfile, "\n");
         }          }
 }  }

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

CVSweb <webmaster@jp.NetBSD.org>