On 19. 6. 25 00:17, Branko Čibej wrote:
On 18. 6. 25 23:20, C. Michael Pilato wrote:
Disclaimer: I haven't looked at this codebase in a reeeeeally long
time. But this code in cmdline.c reads differently than my now-naive
eyes would expect:
/* If neither --non-interactive nor --force-interactive was passed,
* be interactive if stdin is a terminal.
* If --force-interactive was passed, always be interactive. */
if (!force_interactive && !*non_interactive)
*non_interactive = svn_cmdline__stdin_is_a_terminal();
This looks to have been introduced relatively recently, in r1925937
(https://svn.apache.org/viewvc/?view=revision&revision=1925937
<https://svn.apache.org/viewvc/?view=revision&revision=1925937>). I
guess I would expect it to read:
if (!force_interactive && !*non_interactive)
*non_interactive = !svn_cmdline__stdin_is_a_terminal();
That is, be non-interactive if stdin is NOT a terminal. But, yeah,
see the disclaimer above. :-)
-- Mike
As the saying goes: dammit, Mike, not you again! :D
You're perfectly right, and our tests never once tickled this case.
Adding that one bang fixes the problem for me. Writing a test for this
case now – it's already failing, I just have to adjust expected_stderr.
And yeah, looking at that diff now, it's kind of obvious. 🙄
Thanks!
-- Brane
Fixed in r1926563. Not even a one-liner, more of a one-banger. :)
-- Brane