List for cgit developers and users
 help / color / mirror / Atom feed
* [RESEND] [PATCH v1 1/2] syntax-highlight: when the file has no extension, assume text
@ 2012-10-09 11:10 mailings
  2012-10-09 11:10 ` [RESEND] [PATCH v1 2/2] syntax-highlight: fix POSIX '==' issues mailings
  0 siblings, 1 reply; 3+ messages in thread
From: mailings @ 2012-10-09 11:10 UTC (permalink / raw)


From: Ferry Huberts <ferry.huberts at pelagic.nl>

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 <ferry.huberts at pelagic.nl>
---
 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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [RESEND] [PATCH v1 2/2] syntax-highlight: fix POSIX '==' issues
  2012-10-09 11:10 [RESEND] [PATCH v1 1/2] syntax-highlight: when the file has no extension, assume text mailings
@ 2012-10-09 11:10 ` mailings
  2012-10-09 11:20   ` Jason
  0 siblings, 1 reply; 3+ messages in thread
From: mailings @ 2012-10-09 11:10 UTC (permalink / raw)


From: Ferry Huberts <ferry.huberts at pelagic.nl>

Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
 filters/syntax-highlighting.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
index 8b09180..1178502 100755
--- a/filters/syntax-highlighting.sh
+++ b/filters/syntax-highlighting.sh
@@ -39,11 +39,11 @@
 BASENAME="$1"
 EXTENSION="${BASENAME##*.}"
 
-[ "${BASENAME}" == "${EXTENSION}" ] && EXTENSION=txt
+[ "${BASENAME}" = "${EXTENSION}" ] && EXTENSION=txt
 [ -z "${EXTENSION}" ] && EXTENSION=txt
 
 # map Makefile and Makefile.* to .mk
-[ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk
+[ "${BASENAME%%.*}" = "Makefile" ] && EXTENSION=mk
 
 # highlight versions 2 and 3 have different commandline options. Specifically,
 # the -X option that is used for version 2 is replaced by the -O xhtml option
-- 
1.7.11.4





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [RESEND] [PATCH v1 2/2] syntax-highlight: fix POSIX '==' issues
  2012-10-09 11:10 ` [RESEND] [PATCH v1 2/2] syntax-highlight: fix POSIX '==' issues mailings
@ 2012-10-09 11:20   ` Jason
  0 siblings, 0 replies; 3+ messages in thread
From: Jason @ 2012-10-09 11:20 UTC (permalink / raw)


Combined and applied:
http://git.zx2c4.com/cgit/commit/?id=d14faf4424ae06ced696c15f205c85fe55b8e6e7




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-09 11:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-09 11:10 [RESEND] [PATCH v1 1/2] syntax-highlight: when the file has no extension, assume text mailings
2012-10-09 11:10 ` [RESEND] [PATCH v1 2/2] syntax-highlight: fix POSIX '==' issues mailings
2012-10-09 11:20   ` Jason

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).