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

Diff for /src/usr.bin/ssh/sftp.c between version 1.128 and 1.129

version 1.128, 2010/09/25 09:30:16 version 1.129, 2010/09/26 22:26:33
Line 735 
Line 735 
 do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,  do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
     int lflag)      int lflag)
 {  {
         glob_t g;  
         u_int i, c = 1, colspace = 0, columns = 1;  
         Attrib *a = NULL;          Attrib *a = NULL;
         int err;  
         char *fname, *lname;          char *fname, *lname;
           glob_t g;
           int err;
           struct winsize ws;
           u_int i, c = 1, colspace = 0, columns = 1, m = 0, width = 80;
   
         memset(&g, 0, sizeof(g));          memset(&g, 0, sizeof(g));
   
Line 766 
Line 767 
                 return err;                  return err;
         }          }
   
         if (!(lflag & LS_SHORT_VIEW)) {          if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1)
                 u_int m = 0, width = 80;                  width = ws.ws_col;
                 struct winsize ws;  
   
           if (!(lflag & LS_SHORT_VIEW)) {
                 /* Count entries for sort and find longest filename */                  /* Count entries for sort and find longest filename */
                 for (i = 0; g.gl_pathv[i]; i++)                  for (i = 0; g.gl_pathv[i]; i++)
                         m = MAX(m, strlen(g.gl_pathv[i]));                          m = MAX(m, strlen(g.gl_pathv[i]));
   
                 if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1)  
                         width = ws.ws_col;  
   
                 columns = width / (m + 2);                  columns = width / (m + 2);
                 columns = MAX(columns, 1);                  columns = MAX(columns, 1);

Legend:
Removed from v.1.128  
changed lines
  Added in v.1.129