X-Git-Url: https://git.gag.com/?p=debian%2Famanda;a=blobdiff_plain;f=perl%2FAmanda%2FUtil.swg;h=e4a3e6b655835fd6c893c5df728bb8078b21b17b;hp=2043b44122b87fddc0dcbae06cb76c9a0d88131d;hb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;hpb=fd48f3e498442f0cbff5f3606c7c403d0566150e diff --git a/perl/Amanda/Util.swg b/perl/Amanda/Util.swg index 2043b44..e4a3e6b 100644 --- a/perl/Amanda/Util.swg +++ b/perl/Amanda/Util.swg @@ -209,6 +209,21 @@ sub skip_quoted_string { return ($quoted_string, $remainder); } +sub split_quoted_string_friendly { + my $str = shift; + my @result; + + chomp $str; + $str =~ s/^\s+//; + while ($str) { + (my $elt, $str) = skip_quoted_string($str); + push @result, unquote_string($elt); + $str =~ s/^\s+// if $str; + } + + return @result; +} + %} amglue_export_ok(slurp); @@ -330,7 +345,8 @@ GPtrArray *expand_braced_alternates(char *); %newobject collapse_braced_alternates; char *collapse_braced_alternates(GPtrArray *source); gchar **split_quoted_strings(const gchar *string); -amglue_export_tag(quoting, quote_string unquote_string skip_quoted_string sanitise_filename split_quoted_strings); +amglue_export_tag(quoting, quote_string unquote_string skip_quoted_string + sanitise_filename split_quoted_strings split_quoted_strings_friendly); amglue_export_tag(alternates, expand_braced_alternates collapse_braced_alternates); %perlcode %{