[X2Go-Commits] [x2goserver] 14/50: xsettings: add sanitize_line shell function to remove white space and comments from an xsettingsd config file line.

git-admin at x2go.org git-admin at x2go.org
Thu Jan 14 05:13:54 CET 2016


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/x2goserver-xsettings
in repository x2goserver.

commit acd5210328fbe401b844c79119120d3b06d871a0
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Mon Nov 24 00:57:36 2014 +0100

    xsettings: add sanitize_line shell function to remove white space and comments from an xsettingsd config file line.
---
 .../post-start.d/900_xsettings-xsettingsd-startup  |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/x2goserver-xsettings/lib/x2go/extensions/post-start.d/900_xsettings-xsettingsd-startup b/x2goserver-xsettings/lib/x2go/extensions/post-start.d/900_xsettings-xsettingsd-startup
index 09b48a0..b48a8eb 100644
--- a/x2goserver-xsettings/lib/x2go/extensions/post-start.d/900_xsettings-xsettingsd-startup
+++ b/x2goserver-xsettings/lib/x2go/extensions/post-start.d/900_xsettings-xsettingsd-startup
@@ -19,6 +19,18 @@
 #
 # Copyright (C) 2014 Mihai Moldovan <ionic at ionic.de>
 
+# Removes redundant white space and comments.
+# Note that in-line comments are supported.
+# Comments start with a hash and everything succeeding, as well as the hash character
+#  itself will be removed.
+sanitize_line() {
+  INPUT="${1}"
+
+  [ -z "${INPUT}" ] && echo ""
+
+  echo "${INPUT}" | sed -e 's/^[[:blank:]]*//' -e 's/#.*//'
+}
+
 merge() {
   BASE_FILE="${1}"
   OVERRIDES_FILE="${2}"

--
Alioth's /srv/git/code.x2go.org/x2goserver.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list