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

Diff for /src/usr.bin/ftp/util.c between version 1.64 and 1.65

version 1.64, 2009/11/11 17:10:25 version 1.65, 2014/01/23 00:39:15
Line 753 
Line 753 
  */   */
 static struct timeval start;  static struct timeval start;
   
   char *action;
   
 void  void
 progressmeter(int flag, const char *filename)  progressmeter(int flag, const char *filename)
 {  {
Line 792 
Line 794 
                 if (filename != NULL)                  if (filename != NULL)
                         title = strdup(filename);                          title = strdup(filename);
         }          }
   
           buf[0] = 0;
           if (!verbose && action != NULL) {
                   int l = strlen(action);
                   char *dotdot = "";
   
                   if (l < 7)
                           l = 7;
                   else if (l > 12) {
                           l = 12;
                           dotdot = "...";
                           overhead += 3;
                   }
                   snprintf(buf, sizeof(buf), "\r%-*.*s%s ", l, l, action,
                       dotdot);
                   overhead += l + 1;
           } else
                   snprintf(buf, sizeof(buf), "");
   
         if (!verbose && title != NULL) {          if (!verbose && title != NULL) {
                 int l = strlen(title);                  int l = strlen(title);
                 char *dotdot = "";                  char *dotdot = "";
Line 803 
Line 824 
                         dotdot = "...";                          dotdot = "...";
                         overhead += 3;                          overhead += 3;
                 }                  }
                 snprintf(buf, sizeof(buf), "\r%-*.*s%s %3d%% ", l, l, title,                  snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
                       "%-*.*s%s %3d%% ", l, l, title,
                     dotdot, ratio);                      dotdot, ratio);
                 overhead += l + 1;                  overhead += l + 1;
         } else          } else

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65