List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH v1 1/1] syntax-highlight: when the file has no extension, assume text
@ 2012-04-04 16:05 mailings
  0 siblings, 0 replies; only message in thread
From: mailings @ 2012-04-04 16:05 UTC (permalink / raw)


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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-04 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-04 16:05 [PATCH v1 1/1] syntax-highlight: when the file has no extension, assume text mailings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).