~willismonroe/ubuntu/precise/xdg-utils/typo-fix-996304

« back to all changes in this revision

Viewing changes to debian/patches/xdg-open-printf.diff

  • Committer: Bazaar Package Importer
  • Author(s): Per Olofsson
  • Date: 2011-02-20 18:34:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110220183453-7p0edr23dygfhseg
Tags: 1.1.0~rc1-2
* Tag patches with upstream bug URLs.
* Add patch xdg-mime-follow-symlinks.diff: Follow symlinks when
  querying MIME type in xdg-mime.
* Add patch xdg-open-browser-multiword.diff: Fix support for multi-word
  $BROWSER commands. Closes: #612339.
* Add patch xdg-open-printf.diff: Use /usr/bin/printf if available when
  decoding URLs. dash's printf doesn't understand \xHH
  sequences. Closes: #613272.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Use /usr/bin/printf if available when decoding URLs.
 
2
 dash's printf doesn't understand \xHH sequences.
 
3
Author: Per Olofsson <pelle@debian.org>
 
4
Bug: http://bugs.debian.org/613272
 
5
 
 
6
--- a/scripts/xdg-open
 
7
+++ b/scripts/xdg-open
 
8
@@ -420,7 +420,11 @@ open_generic()
 
9
         # Decode URLs
 
10
         if echo "$file" | grep -q '^file:///'; then
 
11
             file=${file#file://}
 
12
-            file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")"
 
13
+            local printf=printf
 
14
+            if [ -x /usr/bin/printf ]; then
 
15
+                printf=/usr/bin/printf
 
16
+            fi
 
17
+            file="$($printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")"
 
18
         fi
 
19
         check_input_file "$file"
 
20