busybox/util-linux
Ron Yorston 4357569fdc rev: correct output for long input lines
The input buffer is initialised to a reasonable size and extended
if necessary.  When this happened the offset into the buffer wasn't
reset to zero so subsequent lines were appended to the long line.

Fix this and add some tests.

function                                             old     new   delta
rev_main                                             377     368      -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-9)               Total: -9 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-08-22 00:08:18 +02:00
..
volume_id decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
acpid.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
blkdiscard.c
blkid.c
blockdev.c blockdev: support --get/setra 2021-06-16 17:00:56 +02:00
cal.c
chrt.c help text tweaks 2020-12-18 04:12:51 +01:00
Config.src
dmesg.c *: --help tweaks 2021-06-14 20:47:20 +02:00
eject.c
fallocate.c
fatattr.c
fbset.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
fdformat.c
fdisk_aix.c
fdisk_gpt.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
fdisk_osf.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
fdisk_sgi.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
fdisk_sun.c fdisk: indentation fix 2021-08-16 11:13:30 +02:00
fdisk.c fdisk: commonalize strings 2021-06-25 01:14:43 +02:00
findfs.c
flock.c *: more --help tweaking 2021-06-13 03:51:55 +02:00
freeramdisk.c
fsck_minix.c
fsfreeze.c
fstrim.c help text: replace [OPTIONS] with actual options (if not too long) 2020-12-13 22:34:05 +01:00
getopt.c
hexdump_xxd.c xxd: compat tweak for -i 2021-06-25 00:16:04 +02:00
hexdump.c more --help text tweaks 2020-12-13 19:18:28 +01:00
hwclock.c libbb: introduce and use xgettimeofday(), do not truncate 64-bit time_t in shells 2020-12-30 23:48:01 +01:00
ionice.c ionice: implement -t 2021-06-17 13:45:13 +02:00
ipcrm.c
ipcs.c
Kbuild.src
last_fancy.c
last.c
losetup.c
lspci.c
lsusb.c
mdev.c libbb: introduce and use xgettimeofday(), do not truncate 64-bit time_t in shells 2020-12-30 23:48:01 +01:00
mesg.c
minix.h
mkfs_ext2_test.sh
mkfs_ext2.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
mkfs_ext2.txt
mkfs_minix.c
mkfs_reiser.c
mkfs_vfat.c
mkswap.c libbb: add and use infrastructure for fixed page size optimization 2020-12-14 18:54:30 +01:00
more.c
mount.c mount: Surround syslog.h with the config check 2020-12-25 18:15:37 +01:00
mountpoint.c *: more --help tweaking 2021-06-13 03:51:55 +02:00
nologin.c
nsenter.c help text tweaks 2020-12-18 04:12:51 +01:00
pivot_root.c
rdate.c libbb: introduce and use xsettimeofday() 2020-12-16 21:36:36 +01:00
rdev.c
readprofile.c *: more --help tweaking 2021-06-13 03:51:55 +02:00
renice.c *: more --help tweaks 2021-06-15 10:00:18 +02:00
rev.c rev: correct output for long input lines 2021-08-22 00:08:18 +02:00
rtcwake.c move ADJTIME_PATH define to header files 2020-12-17 20:53:43 +01:00
script.c libbb: introduce and use xgettimeofday(), do not truncate 64-bit time_t in shells 2020-12-30 23:48:01 +01:00
scriptreplay.c
setarch.c
setpriv.c help text tweaks 2020-12-18 04:12:51 +01:00
setsid.c
swaponoff.c
switch_root.c switch_root: code shrink - use iterate_on_dir() 2021-06-24 17:54:11 +02:00
taskset.c taskset: disallow "taskset -p 0" 2021-08-15 20:41:18 +02:00
uevent.c help text tweaks 2020-12-18 04:12:51 +01:00
umount.c help text: replace [OPTIONS] with actual options (if not too long) 2020-12-13 22:34:05 +01:00
unshare.c help text tweaks 2020-12-18 04:12:51 +01:00
wall.c