Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/ftp/curl/files/patch-src-tool_operate.c
16130 views
1
--- src/tool_operate.c.orig 2019-11-04 08:43:26 UTC
2
+++ src/tool_operate.c
3
@@ -992,20 +992,7 @@ static CURLcode single_transfer(struct G
4
DEBUGASSERT(!outs->filename);
5
}
6
7
- if(config->resume_from_current) {
8
- /* We're told to continue from where we are now. Get the size
9
- of the file as it is now and open it for append instead */
10
- struct_stat fileinfo;
11
- /* VMS -- Danger, the filesize is only valid for stream files */
12
- if(0 == stat(per->outfile, &fileinfo))
13
- /* set offset to current file size: */
14
- config->resume_from = fileinfo.st_size;
15
- else
16
- /* let offset be 0 */
17
- config->resume_from = 0;
18
- }
19
-
20
- if(config->resume_from) {
21
+ if(config->resume_from || config->resume_from_current) {
22
#ifdef __VMS
23
/* open file for output, forcing VMS output format into stream
24
mode which is needed for stat() call above to always work. */
25
@@ -1022,6 +1009,19 @@ static CURLcode single_transfer(struct G
26
}
27
outs->fopened = TRUE;
28
outs->stream = file;
29
+
30
+ if(config->resume_from_current) {
31
+ /* We're told to continue from where we are now. Get the size
32
+ of the file as it is now */
33
+ struct_stat fileinfo;
34
+ if(0 == fstat(fileno(outs->stream), &fileinfo))
35
+ /* set offset to current file size: */
36
+ config->resume_from = fileinfo.st_size;
37
+ else
38
+ /* let offset be 0 */
39
+ config->resume_from = 0;
40
+ }
41
+
42
outs->init = config->resume_from;
43
}
44
else {
45
46