gawk breaks cat -v
<!--
Please read our Bug reporting guidelines before opening a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
If you want to help catching more bugs upfront, consider joining the Arch Testing Team:
https://wiki.archlinux.org/title/Arch_Testing_Team
-->
# Description:
When `awk` (linked to `gawk-5.3.1`) prints something to the terminal, it seems to break every subsequent call to `cat -v`.
The error message from `cat` is:
```sh
cat: -: input file is output file
```
I set up a Virtual Machine with Ubuntu 24.10 and compiled `gawk-5.3.1` from the source, and the issue is not reproducible there.
However, it can be reproduced on the Arch Installer ISO with the same version (see below).
Signs:
- [ ] no issue
- [x] issue present
Special conditions to reproduce the error:
1. [ ] No stdout (no issue):
```sh
gawk '' &>/dev/null
```
2. [x] Something is printed:
```sh
gawk ''
echo "1 2 3" | gawk '{print $1}'
gawk --version
gawk --help
```
Affected commits of `gawk`:
1. [ ] aclocal 1.16.5 - `45d52267` Better fix for inplace tests on BSD systems.
2. [x] aclocal 1.16 - `f43f8f01` Update doc/gawk.info.
3. [x] Right after `./configure`.
It means that all commits below `f43f8f01`, including version 5.3.1, produce this error.
The same applies to `awk` (`gawk-5.3.1`) downloaded from the official repository and to the `gawk-5.3.1` compiled from the source code.
Note: `mawk` works fine.
# Additional info:
* package version(s): gawk-5.3.1
* config and/or log files: none
* link to upstream bug report, if any: https://lists.gnu.org/archive/html/bug-gawk/2025-03/threads.html
# Steps to reproduce:
1. gawk ''
2. cat -v
issue