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

Diff for /src/usr.bin/rsync/fargs.c between version 1.2 and 1.3

version 1.2, 2019/02/10 23:24:14 version 1.3, 2019/02/11 21:41:22
Line 31 
Line 31 
         size_t            i = 0, j, argsz = 0;          size_t            i = 0, j, argsz = 0;
         const char       *rsync_path;          const char       *rsync_path;
   
         assert(NULL != f);          assert(f != NULL);
         assert(f->sourcesz > 0);          assert(f->sourcesz > 0);
   
         if (NULL == (rsync_path = sess->opts->rsync_path))          if ((rsync_path = sess->opts->rsync_path) == NULL)
                 rsync_path = RSYNC_PATH;                  rsync_path = RSYNC_PATH;
   
         /* Be explicit with array size. */          /* Be explicit with array size. */
Line 47 
Line 47 
         argsz += f->sourcesz;          argsz += f->sourcesz;
   
         args = calloc(argsz, sizeof(char *));          args = calloc(argsz, sizeof(char *));
         if (NULL == args) {          if (args == NULL) {
                 ERR(sess, "calloc");                  ERR(sess, "calloc");
                 return NULL;                  return NULL;
         }          }
   
         if (NULL != f->host) {          if (f->host != NULL) {
                 assert(NULL != f->host);                  assert(f->host != NULL);
                 args[i++] = "ssh";  
                   args[i++] = sess->opts->ssh ? sess->opts->ssh : "ssh";
                 args[i++] = f->host;                  args[i++] = f->host;
                 args[i++] = (char *)rsync_path;                  args[i++] = (char *)rsync_path;
                 args[i++] = "--server";                  args[i++] = "--server";
                 if (FARGS_RECEIVER == f->mode)                  if (f->mode == FARGS_RECEIVER)
                         args[i++] = "--sender";                          args[i++] = "--sender";
         } else {          } else {
                 args[i++] = (char *)rsync_path;                  args[i++] = (char *)rsync_path;
Line 92 
Line 93 
   
         args[i++] = ".";          args[i++] = ".";
   
         if (FARGS_RECEIVER == f->mode) {          if (f->mode == FARGS_RECEIVER) {
                 for (j = 0; j < f->sourcesz; j++)                  for (j = 0; j < f->sourcesz; j++)
                         args[i++] = f->sources[j];                          args[i++] = f->sources[j];
         } else          } else

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3