Skip to content

Commit

Permalink
Allow quoting of per-backup-point options
Browse files Browse the repository at this point in the history
Use the parse_line function from Text::ParseWords when parsing
backup options.  This allows options to be quoted, which in turn
allows options to contain commas, which is needed for the mount
command used with LVM backups.
  • Loading branch information
galenseitz committed Dec 13, 2022
1 parent 080d526 commit 2fe4779
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rsnapshot-program.pl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
use IO::File; # recursive open in parse_config_file
use IPC::Open3 qw(open3); #open rsync with error output
use IO::Handle; # handle autoflush for rsync-output
use Text::ParseWords; # parse_line()

########################################
### CPAN MODULES ###
Expand Down Expand Up @@ -1770,7 +1771,7 @@ sub parse_backup_opts {
if (!$opts_str) { return (undef); }

# split on commas first
@pairs = split(/,/, $opts_str);
@pairs = parse_line(',', 0, $opts_str);

# then loop through and split on equals
foreach my $pair (@pairs) {
Expand Down

0 comments on commit 2fe4779

Please sign in to comment.