From mboxrd@z Thu Jan 1 00:00:00 1970 From: mailings at hupie.com (Ferry Huberts) Date: Tue, 9 Oct 2012 13:10:48 +0200 Subject: [RESEND] [PATCH v1 1/2] syntax-highlight: when the file has no extension, assume text Message-ID: <1349781049-6971-1-git-send-email-mailings@hupie.com> From: Ferry Huberts There are 2 situations: 1- empty extension: assuming text is better than highlight producing no output because of a missing argument. 2- no extension at all: assuming text is better than setting the extension to the filename, which is what now happens. Signed-off-by: Ferry Huberts --- filters/syntax-highlighting.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh index 5fcc9c9..8b09180 100755 --- a/filters/syntax-highlighting.sh +++ b/filters/syntax-highlighting.sh @@ -39,6 +39,9 @@ BASENAME="$1" EXTENSION="${BASENAME##*.}" +[ "${BASENAME}" == "${EXTENSION}" ] && EXTENSION=txt +[ -z "${EXTENSION}" ] && EXTENSION=txt + # map Makefile and Makefile.* to .mk [ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk -- 1.7.11.4