return CURL_WRITEFUNC_ERROR;
}
+ if(per->config->output_dir) {
+ outs->filename = aprintf("%s/%s", per->config->output_dir, filename);
+ free(filename);
+ if(!outs->filename)
+ return CURL_WRITEFUNC_ERROR;
+ }
+ else
+ outs->filename = filename;
+
outs->is_cd_filename = TRUE;
outs->s_isreg = TRUE;
outs->fopened = FALSE;
- outs->filename = filename;
outs->alloc_filename = TRUE;
hdrcbdata->honor_cd_filename = FALSE; /* done now! */
if(!tool_create_output_file(outs, per->config))
struct GlobalConfig *global;
FILE *file = NULL;
char *fname = outs->filename;
- char *aname = NULL;
DEBUGASSERT(outs);
DEBUGASSERT(config);
global = config->global;
return FALSE;
}
- if(config->output_dir && outs->is_cd_filename) {
- aname = aprintf("%s/%s", config->output_dir, fname);
- if(!aname) {
- errorf(global, "out of memory");
- return FALSE;
- }
- fname = aname;
- }
-
if(config->file_clobber_mode == CLOBBER_ALWAYS ||
(config->file_clobber_mode == CLOBBER_DEFAULT &&
!outs->is_cd_filename)) {
char *newname;
/* Guard against wraparound in new filename */
if(newlen < len) {
- free(aname);
errorf(global, "overflow in filename generation");
return FALSE;
}
newname = malloc(newlen);
if(!newname) {
errorf(global, "out of memory");
- free(aname);
return FALSE;
}
memcpy(newname, fname, len);
if(!file) {
warnf(global, "Failed to open the file %s: %s", fname,
strerror(errno));
- free(aname);
return FALSE;
}
- free(aname);
outs->s_isreg = TRUE;
outs->fopened = TRUE;
outs->stream = file;
-O
-J
--output-dir
+--remote-time
</keywords>
</info>
#
http
</features>
<name>
---output-dir with -J
+--output-dir with -J and -R
</name>
<command option="no-output,no-include">
-http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -OJ --output-dir %PWD/%LOGDIR
+http://%HOSTIP:%HTTPPORT/this/is/the/%TESTNUMBER -OJR --output-dir %PWD/%LOGDIR
</command>
</client>