- for (i = argc - orig_argc; i < argc; i++) {
- if (!strcmp(argv[i], "-F")) { /* safer to change it here than script */
- strncat(buff, "-f ", 3); /* chg to -f + ext to get ready for remote */
- strncat(buff, batch_file_ext,
- strlen(batch_file_ext));
+ for (i = 0; i < argc; ++i) {
+ if (i == argc - 2)
+ continue;
+ /*
+ * FIXME:
+ * I think directly manipulating argv[] is probably bogus
+ */
+ if (!strcmp(argv[i], "--write-batch")) {
+ /* Safer to change it here than script */
+ /* Change to --read-batch + ext * to get ready for remote */
+ strlcat(buff, "--read-batch ", sizeof(buff));
+ strlcat(buff, batch_file_ext, sizeof(buff));