From 0d3c435e65b344fe493a184daa7cd23fc2704d70 Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sat, 4 Oct 2008 21:10:05 +0000 Subject: [PATCH] Don't break double-quoted strings in cmake-options when constructing the command line for running cmake. This allows users to add options with embedded spaces. Only double-quoting is supported, without backslash-escaping inside the double quotes. Patch provided by Alain Boyer (bug reporter), thanks! BUG:171814 svn path=/trunk/KDE/kdesdk/scripts/kdesvn-build; revision=867894 --- kdesvn-build | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/kdesvn-build b/kdesvn-build index eb3d40f..05eb299 100755 --- a/kdesvn-build +++ b/kdesvn-build @@ -829,6 +829,32 @@ sub get_output_file return $fname; } +# This subroutine acts like split(' ', $_) except that double-quoted strings are not split in +# the process. Patch provided by Alain Boyer (alainboyer@gmail.com) based on a posting at +# http://www.perlmonks.org/?node_id=212174. Converted to an extended RE for readability by +# mpyne. +# +# First parameter: String to split on whitespace. +# Return value: A list of the individual words and quoted values in the string. +sub split_quoted_on_whitespace($) +{ + my $str = shift; + my @words = $str =~ + /"? # Match 0-1 quotes + ( # Open grouping expression + (?