To whom it may concern,

Thanks for GNU Indent! I've found it quite helpful for my projects.

I recently came across a source file where running Indent twice
produces different output.
The first pass makes a change and the second pass reverts it.
I'm using version 2.2.13 on macOS; it's installed through Homebrew.

The attached file is a reduced test case from the Gofer Haskell
(https://github.com/haskell-implementations/gofer) implementation.that
exhibits this behavior. The original code is a hash table lookup and
fairly convoluted. I've removed or replaced as much of the logic as
possible, so the code in the test case doesn't make a lot of sense. It
is, however, compilable C.

Steps to Reproduce:
1. Save the attached file to your computer.
2. Run Indent as "indent -kr -i4 -nut testcase.c -o once.c".
The output file will have the break on line 13 merged with line 12.
3. Run Indent as "indent -kr -i4 -nut once.c -o twice.c"
The output file will have the break on line 12 split to line 13 again.
4. Run Diff on "diff testcase.c twice.c"
No output will appear because the two files are identical.

Hopefully the above makes sense; Please let me know if you have any
questions about this issue.

Regards,
David Bremner

Attachment: testcase.c
Description: Binary data

Reply via email to