Commit Graph

4 Commits

Author SHA1 Message Date
WebFreak001 4a6078779a Fix #568, don't output empty files without error
Now when an error in formatting happens, it never outputs anything and
doesn't override the file when working inplace.

Additionally dfmt is no longer able to fail in the middle of a file, as
now we first write everything to a buffer and only if everything was
successful, that buffer is printed to stdout or written to the inplace
file.

This should also guard against segfaults with inplace file formatting
erasing parts of the file, as well as the user thinking it was
successful, even though dfmt didn't finish properly.
2022-10-15 02:33:04 +02:00
Bastiaan Veelo 2a4af7a2b2
Retain line ending by default. (#553) 2022-07-28 17:21:10 +02:00
Bastiaan Veelo b8da7c5cd4 Refactor courtesy WebFreak001.
Co-authored-by: Jan Jurzitza <gh@webfreak.org>
2022-05-27 19:47:47 +02:00
Bastiaan Veelo f6d9d04e43 Port `test.sh` to platform independent D.
This executes also way faster by not spawning GNU diff.
2022-05-26 16:10:07 +02:00