Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Detect and report limitation where .gz and .bz2 filenames can't conta…

…in single quotes
  • Loading branch information...
commit a2ccf618c5355a4ead023b2801cb6a3215778620 1 parent 5ec8737
@hoytech authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 bin/log-defer-viz
View
5 bin/log-defer-viz
@@ -148,11 +148,14 @@ unshift(@ARGV, '-') unless @ARGV;
while (my $file = shift) {
my $fh;
- ## FIXME: do this with a perl module in case zcat/bzcat aren't available
+ ## FIXME: Do these with perl modules in case zcat/bzcat aren't available.
+ ## This would also fix stupid single quote limitation below.
if ($file =~ /[.]gz$/) {
+ die qq{filename "$file" can't contain single quotes } if $file =~ /'/;
open($fh, "zcat '$file' |") || die "couldn't open $file with zcat: $!";
} elsif ($file =~ /[.]bz2$/) {
+ die qq{filename "$file" can't contain single quotes } if $file =~ /'/;
open($fh, "bzcat '$file' |") || die "couldn't open $file with bzcat: $!";
} elsif ($file eq '-') {
$fh = \*STDIN;
Please sign in to comment.
Something went wrong with that request. Please try again.