[Swift-commit] r3230 - trunk/libexec
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Fri Feb 5 16:58:42 CST 2010
Author: wozniak
Date: 2010-02-05 16:58:42 -0600 (Fri, 05 Feb 2010)
New Revision: 3230
Modified:
trunk/libexec/cdm.pl
Log:
Ensure that the CDM policy file is queried in-order.
Modified: trunk/libexec/cdm.pl
===================================================================
--- trunk/libexec/cdm.pl 2010-02-05 17:34:48 UTC (rev 3229)
+++ trunk/libexec/cdm.pl 2010-02-05 22:58:42 UTC (rev 3230)
@@ -12,11 +12,12 @@
sub cdm_lookup
{
- my $hash = $_[0];
- my $file = $_[1];
+ my $keys = $_[0];
+ my $hash = $_[1];
+ my $file = $_[2];
$result = "DEFAULT";
- foreach (keys %$hash)
+ foreach (@$keys)
{
$pattern = $_;
if ($file =~ /$pattern/)
@@ -32,7 +33,8 @@
$file = $ARGV[0];
# Read fs.data off of stdin:
-%map = ();
+ at keys = ();
+%map = ();
while (<STDIN>)
{
chomp;
@@ -41,7 +43,8 @@
@tokens = split(/ /, $_);
$key = shift(@tokens);
$rest = join(' ', @tokens);
+ @keys = (@keys, $key);
$map{$key} = $rest;
}
-cdm_lookup(\%map, $file);
+cdm_lookup(\@keys, \%map, $file);
More information about the Swift-commit
mailing list