Skip to content

Commit

Permalink
DwMararc.c: Have incomplete last line be non-fatal in Windows
Browse files Browse the repository at this point in the history
See #102

It would seem too many Windows applications happily allow a text
file to have an incomplete last line (*NIX editors usually won’t)

Ugh.
  • Loading branch information
Sam Trenholme committed Mar 11, 2022
1 parent b07ed45 commit e47aaaf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion deadwood-github/src/DwMararc.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2007-2020 Sam Trenholme
/* Copyright (c) 2007-2022 Sam Trenholme
*
* TERMS
*
Expand Down Expand Up @@ -793,7 +793,14 @@ int dwm_parse_file(char *name) {
do {
a = dwm_parse_line(look);
if(a == -3) {
#ifndef MINGW
dwm_fatal("incomplete last line");
#else
/* Windows has too many broken editors which make
* an incomplete last line. */
dw_alog_number(
"Warning in dwood3rc file on line ",dwm_linenum," incomplete last line");
#endif /* MINGW */
}
if(a != 0 && a != 1) {
dwm_fatal("deadwoodrc parse error");
Expand Down

0 comments on commit e47aaaf

Please sign in to comment.