This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goserver. commit 4234f35dd9dd126c8ac370fee36a054196882a70 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 9 07:54:05 2017 +0100 x2goserver/bin/x2gosetkeyboard: $BASH_REMATCH is tricky, actually fetch the first match. In the $BASH_REMATCH array, index 0 contains the *full* match, while indices 1+ only contain the partial matches. We're only interested in the first partial match. Cherry-picked from release/4.0.1.x branch. --- debian/changelog | 4 ++++ x2goserver/bin/x2gosetkeyboard | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 72e9668..8dab29b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -257,6 +257,10 @@ x2goserver (4.0.1.21-0x2go1) UNRELEASED; urgency=medium ${setxkbmap_opts}, that's what it really is. - x2goserver/bin/x2gosetkeyboard: setxkbmap expects a parameter called "-option", but nxagent uses the key "options". Make setxkbmap happy. + - x2goserver/bin/x2gosetkeyboard: $BASH_REMATCH is tricky, actually fetch + the first match. In the $BASH_REMATCH array, index 0 contains the *full* + match, while indices 1+ only contain the partial matches. We're only + interested in the first partial match. * x2goserver.spec: - Add mandatory perl-generators Build-Requires as per https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl diff --git a/x2goserver/bin/x2gosetkeyboard b/x2goserver/bin/x2gosetkeyboard index 0b5c73e..ed8b1e7 100755 --- a/x2goserver/bin/x2gosetkeyboard +++ b/x2goserver/bin/x2gosetkeyboard @@ -74,7 +74,7 @@ read_keyboard_file() { for key in "rules" "model" "layout" "variant" "options"; do typeset regexp='^[[:space:]]*'"${key}"'[[:space:]]*=[[:space:]]*"?(.*)"?[[:space:]]*' if [[ "${line}" =~ ${regexp} ]]; then - typeset value="${BASH_REMATCH[0]}" + typeset value="${BASH_REMATCH[1]}" if [ -n "${value}" ]; then # Handle a special substitution case for evdev-based rules. -- Alioth's /srv/git/code.x2go.org/x2goserver.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git