> From: Roman <[email protected]>
> Date: Wed, Jan 29, 2014 at 12:05 PM
> Subject: ftp(1) progress meter mad
> To: [email protected]
>
>
> >Synopsis: output of ftp command is ugly when it reads from pipe
> >Category: user
> >Environment:
> System : OpenBSD 5.5
> Details : OpenBSD 5.5-beta (GENERIC.MP) #225: Fri Jan 24
> 12:16:08 MST 2014
>
> [email protected]:/usr/src/sys/arch/i386/compile/GENERIC.MP
>
> Architecture: OpenBSD.i386
> Machine : i386
> >Description: The progress meter of ftp command misses CR in the end of line
> and output is so ugly! Earlier it was ok, at least in 5.4-release.
> Works both in tty and in wide X terminal emulators.
>
> >Fix: Sorry, I'm duck.
Thanks for your report.
The following diff fixes it.
It was a "side-effect" of the addition of "-D" to ftp(1).
ok?
Index: util.c
===================================================================
RCS file: /cvs/src/usr.bin/ftp/util.c,v
retrieving revision 1.65
diff -u -p -u -p -r1.65 util.c
--- util.c 23 Jan 2014 00:39:15 -0000 1.65
+++ util.c 29 Jan 2014 13:47:02 -0000
@@ -825,7 +825,7 @@ progressmeter(int flag, const char *file
overhead += 3;
}
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
- "%-*.*s%s %3d%% ", l, l, title,
+ "\r%-*.*s%s %3d%% ", l, l, title,
dotdot, ratio);
overhead += l + 1;
} else