Normalize C source files to end with exactly one newline

Some editors automatically remove trailing blank lines, or
automatically add a trailing newline to avoid having a trailing
non-blank line that is not terminated by a newline. To avoid unrelated
whitespace changes when users of such editors contribute to GLib,
let's pre-emptively normalize all files.

Unlike more intrusive whitespace normalization like removing trailing
whitespace from each line, this seems unlikely to cause significant
issues with cherry-picking changes to stable branches.

Implemented by:

    find . -name '*.[ch]' -print0 | \
    xargs -0 perl -0777 -p -i -e 's/\n+\z//g; s/\z/\n/g'

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2020-04-21 14:46:33 +01:00
parent a50ad8b10e
commit 44c004c84e
65 changed files with 2 additions and 77 deletions

View File

@@ -178,4 +178,3 @@ _xdg_mime_icon_list_dump (XdgIconList *list)
}
#endif

View File

@@ -215,4 +215,3 @@ _xdg_mime_parent_list_dump (XdgParentList *list)
}
#endif