xdg-utils (1.0.2+cvs20100307-2) run-mailcap-decode.diff

Summary

 scripts/xdg-open |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

    
download this patch

Patch contents

--- a/scripts/xdg-open
+++ b/scripts/xdg-open
@@ -411,10 +411,13 @@ open_generic()
     if (echo "$1" | grep -q '^file://' ||
         ! echo "$1" | egrep -q '^[a-zA-Z+\.\-]+:'); then
 
-        local file=$(echo "$1" | sed 's%^file://%%')
+        local file="$1"
 
         # Decode URLs
-        # TODO
+        if echo "$file" | grep -q '^file:///'; then
+            file=${file#file://}
+            file=$(echo "$file" | perl -pe 's/%(..)/pack("c", hex($1))/eg')
+        fi
 
         check_input_file "$file"