From c0b0afd44e6b8b7bfbe51a8e0640b197f6cf2e33 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 28 Nov 2016 10:36:51 -0700 Subject: [PATCH] eofnl: check for DOS-style newlines Change-Id: Iaaf03848a9187ede3cffd0851291300b2f6c007e Signed-off-by: Daniel Verkamp --- scripts/eofnl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/eofnl b/scripts/eofnl index 004a0c029..bf87eebd2 100755 --- a/scripts/eofnl +++ b/scripts/eofnl @@ -23,4 +23,10 @@ if [[ ! $(tail -c2 "$f") ]]; then exit 1 fi +if grep -q $'\r' "$f"; then + echo "$f: DOS-style newlines" + dos2unix "$f" &> /dev/null + exit 1 +fi + exit 0