[prev in list] [next in list] [prev in thread] [next in thread]
List: cgit
Subject: [PATCH v1 1/1] syntax-highlight: when the file has no extension, assume text
From: mailings () hupie ! com (Ferry Huberts)
Date: 2012-04-04 16:05:55
Message-ID: 1333555555-9873-1-git-send-email-mailings () hupie ! com
[Download RAW message or body]
From: Ferry Huberts <ferry.huberts at pelagic.nl>
Better than setting the extension to the filename, which is
what now happens.
Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
filters/syntax-highlighting.sh | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
index 5fcc9c9..fa597b8 100755
--- a/filters/syntax-highlighting.sh
+++ b/filters/syntax-highlighting.sh
@@ -39,6 +39,11 @@
BASENAME="$1"
EXTENSION="${BASENAME##*.}"
+if [ "${BASENAME}" == "${EXTENSION}" ]; then
+ # the file has no extension, assume text
+ EXTENSION="txt"
+fi
+
# map Makefile and Makefile.* to .mk
[ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk
--
1.7.7.6
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic