When unzip is interrupted with Ctrl+C at an interactive replacement prompt, the shell prompt appears on the same line as ^C.
Steps to reproduce:
1. Create a file and archive it:
tmpdir=$(mktemp -d)
cd "$tmpdir"
printf 'hello\n' > file.txt
zip -q sample.zip file.txt
2. Run:
unzip sample.zip
3. Press Ctrl+C at the replacement prompt.
The current output is:
replace file.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: ^Cuser@host:~$
The expected output is:
replace file.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: ^C
user@host:~$
The signal handler in fileio.c already contains code intended to add a newline. However, its compile-time condition excludes that code on systems defining SIGBUS or SIGSEGV, including Linux, regardless of the signal actually received.
The attached patch preserves the existing behavior on other systems and adds a runtime SIGINT branch when the original condition suppresses the newline.
The problem was originally reproduced with Ubuntu's unzip 6.0-29ubuntu1. I confirmed that the affected code is present in Debian's 6.0-31 source package.
Testing performed:
* Built successfully using the complete Debian patch series.
* Built the binary Debian package successfully with dpkg-buildpackage.
* Debian-profile Lintian completed with exit code 0.
* Confirmed that the shell prompt starts on a new line after Ctrl+C.
* Confirmed that the exit code remains 80.