This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goserver. commit 4760d950b90a9ed646a5a2e36cc8533f59b02a98 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Nov 20 23:37:35 2020 +0100 x2goserver/lib/x2goupdateoptionsstring: add comment regarding the shift () operations after sanitizing program options. --- debian/changelog | 2 ++ x2goserver/bin/x2goupdateoptionsstring | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2a89cd2a..8d5655ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -286,6 +286,8 @@ x2goserver (4.1.0.4-0x2go1.2) UNRELEASED; urgency=medium - X2Go/Server/Agent/NX/Options.pm: reflow some text. - X2Go/Server/Agent/NX/Options.pm: document other non-printable characters. + - x2goserver/lib/x2goupdateoptionsstring: add comment regarding the + shift () operations after sanitizing program options. * debian/control: + Build-depend upon lsb-release for distro version detection. * debian/x2goserver.manpages: diff --git a/x2goserver/bin/x2goupdateoptionsstring b/x2goserver/bin/x2goupdateoptionsstring index 4e4f0993..c867e7c4 100755 --- a/x2goserver/bin/x2goupdateoptionsstring +++ b/x2goserver/bin/x2goupdateoptionsstring @@ -173,6 +173,15 @@ sub Main { my $options = undef; if (!($error_detected)) { + # The shift () operations here actually shift the outer array, not the + # inner elements. + # This can be very confusing. + # The return value is an array consisting of a boolean value and an array + # reference. + # + # Thus, shifting once returns the boolean value, while shifting again + # returns the options array reference. Crucially, no shift () operation + # here modifies the modified options array. $found_separator |= (0 + shift (@{$sanitized_options})); $sanitized_options = shift (@{$sanitized_options}); @program_arguments = @{$sanitized_options}; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git