mirror of
https://github.com/curl/curl.git
synced 2026-04-28 17:02:16 +03:00
tool: reintroduce set file comment code for AmigaOS
Amiga specific code which put the URL in the file comment was perhaps accidentally removed inb889408500having originally been added in5c215bdbdf. Reworked to fit the code changes and added it back in. Reported-by: Michael Trebilcock Originally-added-by: Chris Young Closes #9258
This commit is contained in:
parent
a29d34b0b7
commit
80e9eef737
1 changed files with 18 additions and 0 deletions
|
|
@ -327,6 +327,22 @@ static CURLcode pre_transfer(struct GlobalConfig *global,
|
|||
return result;
|
||||
}
|
||||
|
||||
#ifdef __AMIGA__
|
||||
static void AmigaSetComment(struct per_transfer *per,
|
||||
CURLcode result)
|
||||
{
|
||||
struct OutStruct *outs = &per->outs;
|
||||
if(!result && outs->s_isreg && outs->filename) {
|
||||
/* Set the url (up to 80 chars) as comment for the file */
|
||||
if(strlen(per->this_url) > 78)
|
||||
per->this_url[79] = '\0';
|
||||
SetComment(outs->filename, per->this_url);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define AmigaSetComment(x,y) Curl_nop_stmt
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Call this after a transfer has completed.
|
||||
*/
|
||||
|
|
@ -603,6 +619,8 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
|
|||
}
|
||||
}
|
||||
|
||||
AmigaSetComment(per, result);
|
||||
|
||||
/* File time can only be set _after_ the file has been closed */
|
||||
if(!result && config->remote_time && outs->s_isreg && outs->filename) {
|
||||
/* Ask libcurl if we got a remote file time */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue