Subversion Repositories SvarDOS

Rev

Rev 421 | Rev 502 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 421 Rev 501
Line 53... Line 53...
53
  char src_asciimode[64];
53
  char src_asciimode[64];
54
  char dst_asciimode;
54
  char dst_asciimode;
55
  char last_asciimode; /* /A or /B impacts the file preceding it and becomes the new default for all files that follow */
55
  char last_asciimode; /* /A or /B impacts the file preceding it and becomes the new default for all files that follow */
56
  char verifyflag;
56
  char verifyflag;
57
  char lastitemwasplus;
57
  char lastitemwasplus;
-
 
58
  unsigned short databufsz;
58
  char databuf[BUFFER_SIZE - 1024];
59
  char databuf[1];
59
};
60
};
60
 
61
 
61
 
62
 
62
/* copies src to dst, overwriting or appending to the destination.
63
/* copies src to dst, overwriting or appending to the destination.
63
 * - copy is performed in ASCII mode if asciiflag set (stop at first EOF in src
64
 * - copy is performed in ASCII mode if asciiflag set (stop at first EOF in src
Line 183... Line 184...
183
  }
184
  }
184
 
185
 
185
  /* parse cmdline and fill the setup struct accordingly */
186
  /* parse cmdline and fill the setup struct accordingly */
186
 
187
 
187
  memset(setup, 0, sizeof(*setup));
188
  memset(setup, 0, sizeof(*setup));
-
 
189
  setup->databufsz = p->BUFFERSZ - sizeof(*setup);
188
 
190
 
189
  for (i = 0; i < p->argc; i++) {
191
  for (i = 0; i < p->argc; i++) {
190
 
192
 
191
    /* switch? */
193
    /* switch? */
192
    if (p->argv[i][0] == '/') {
194
    if (p->argv[i][0] == '/') {
Line 339... Line 341...
339
        appendflag = 1;
341
        appendflag = 1;
340
        output(" >> ");
342
        output(" >> ");
341
      }
343
      }
342
      outputnl(setup->dst);
344
      outputnl(setup->dst);
343
 
345
 
-
 
346
      // TODO: reusing setup->databuf not good idea: when 2+ files are being copied, the content of the first one overwrites the pathname of the second one!
344
      t = cmd_copy_internal(setup->dst, 0, setup->databuf, 0, appendflag, setup->databuf, sizeof(setup->databuf));
347
      t = cmd_copy_internal(setup->dst, 0, setup->databuf, 0, appendflag, setup->databuf, setup->databufsz);
345
      if (t != 0) {
348
      if (t != 0) {
346
        outputnl(doserr(t));
349
        outputnl(doserr(t));
347
        return(-1);
350
        return(-1);
348
      }
351
      }
349
 
352