version=20210827;
test -d ./tnftp-$version||exec echo ./tnftp-$version missing;
test ! -f ./tnftp-$version/.PATCHED||exec echo already patched;
set -e;
cd ./tnftp-$version;
ed make-static << eof
i
./configure --enable-ipv6=no
make;
cd src;
gcc -static -g -O2 -o tnftp tnftp-cmds.o tnftp-cmdtab.o tnftp-complete.o tnftp-domacro.o tnftp-fetch.o tnftp-ftp.o tnftp-main.o tnftp-progressbar.o tnftp-ruserpass.o tnftp-ssl.o tnftp-util.o ../libnetbsd/.libs/libnetbsd.a -ledit -lssl -lcrypto -lcurses;
exit
.
wq
eof
ed src/fetch.c << eof;
1143c
if(continuation!=1)
goto cleanup_fetch_url;
.
1141a
if(continuation!=1)
.
1094c
if(continuation!=1)
goto cleanup_fetch_url;
.
1091a
if (continuation!=1)
.
776a
const char *range;
if ((range = getenv("RANGE")) != NULL) {
if(continuation==1)fetch_printf(fin, "Range: bytes=%s\r\n", range);
}
.
wq
eof
ed src/ftp_var.h << eof;
206a
GLOBAL int continuation; /* specify RANGE */
.
wq
eof
ed src/main.c << eof;
1070s/XFERSIZE]/& [-c RANGE]/
.
300a
case 'c':
continuation = 1;
setenv("RANGE",optarg,1);
break;
.
#while((ch=getopt(argc,argv,...
279s/ad/ac:d/
.
wq
eof
echo > .PATCHED;
sh make-static;