Hypens are allowed as key names in RFC822-style data.
[cumulus.git] / contrib / restore.pl
index 5562974..98ae277 100755 (executable)
@@ -359,7 +359,7 @@ sub process_metadata {
         # Try to parse the data as "key: value" pairs of file metadata.  Also
         # handle continuation lines, which start with whitespace and continue
         # the previous "key: value" pair.
-        if ($line =~ m/^(\w+):\s*(.*)$/) {
+        if ($line =~ m/^([-\w]+):\s*(.*)$/) {
             $info{$1} = $2;
             $last_key = $1;
         } elsif ($line =~/^\s/ && defined $last_key) {
@@ -409,7 +409,7 @@ while (defined($line = <DESCRIPTOR>)) {
     # lines.
     chomp $line;
 
-    if ($line =~ m/^(\w+):\s*(.*)$/) {
+    if ($line =~ m/^([-\w]+):\s*(.*)$/) {
         $descriptor{$1} = $2;
         $last_key = $1;
     } elsif ($line =~/^\s/ && defined $last_key) {