Merge branch 'jc/compression-config'
[gitweb.git] / t / t0021 / rot13-filter.pl
old mode 100755 (executable)
new mode 100644 (file)
index ae4c50f..617f581
@@ -1,4 +1,3 @@
-#!/usr/bin/perl
 #
 # Example implementation for the Git filter protocol version 2
 # See Documentation/gitattributes.txt, section "Filter Protocol"
@@ -22,6 +21,7 @@
 
 use strict;
 use warnings;
+use IO::File;
 
 my $MAX_PACKET_CONTENT_SIZE = 65516;
 my @capabilities            = @ARGV;
@@ -109,14 +109,18 @@ sub packet_flush {
 $debug->flush();
 
 while (1) {
-       my ($command) = packet_txt_read() =~ /^command=([^=]+)$/;
+       my ($command) = packet_txt_read() =~ /^command=(.+)$/;
        print $debug "IN: $command";
        $debug->flush();
 
-       my ($pathname) = packet_txt_read() =~ /^pathname=([^=]+)$/;
+       my ($pathname) = packet_txt_read() =~ /^pathname=(.+)$/;
        print $debug " $pathname";
        $debug->flush();
 
+       if ( $pathname eq "" ) {
+               die "bad pathname '$pathname'";
+       }
+
        # Flush
        packet_bin_read();