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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Description: Follow symlinks when querying MIME type in xdg-mime.
 Otherwise we get stuff like inode/symlink back.
Author: Per Olofsson <pelle@debian.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33097

--- a/scripts/xdg-mime
+++ b/scripts/xdg-mime
@@ -495,14 +495,12 @@ info_kde()
 
 info_gnome()
 {
-    file=`readlink -f "$1"` # Normalize path
-
     if gvfs-info --help 2>/dev/null 1>&2; then
-        DEBUG 1 "Running gvfs-info \"$file\""
-        gvfs-info "$file" 2> /dev/null | grep standard::content-type | cut -d' ' -f4
+        DEBUG 1 "Running gvfs-info \"$1\""
+        gvfs-info "$1" 2> /dev/null | grep standard::content-type | cut -d' ' -f4
     else
-       DEBUG 1 "Running gnomevfs-info \"$file\""
-       gnomevfs-info --slow-mime "$file" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "//
+       DEBUG 1 "Running gnomevfs-info \"$1\""
+       gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "//
     fi
 
     if [ $? -eq 0 ]; then
@@ -751,6 +749,7 @@ case $1 in
             ;;
         esac
         check_input_file "$filename"
+        filename=$(readlink -f -- "$filename")
         ;;
 
       default)