• Martin Puppe's avatar
    xdg-mime: return correct exit code for GNOME · 0547886c
    Martin Puppe authored
    If the desktop environment was GNOME and none of the commands for
    detecting the MIME type of a file was available, xdg-mime used to return
    exit code 0 even though it failed. The man page says it should return
    exit code 3. This commit fixes the issue.
    
    I have considered returning exit code 4 instead since that is what would
    be returned if info_kde() or info_generic() fail to find a tool for MIME
    type detection. But I have decided to implement the behavior as
    specified in the man page.
    
    The exit code of an if construct is 0 if no condition
    tested true [^1]. The author of the original code probably was not aware
    of this.
    
    [^1]: https://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html#Conditional-Constructs
    0547886c
Name
Last commit
Last update
autotests Loading commit data...
scripts Loading commit data...
tests Loading commit data...
.dir-locals.el Loading commit data...
.gitignore Loading commit data...
ChangeLog Loading commit data...
LICENSE Loading commit data...
Makefile.in Loading commit data...
README Loading commit data...
RELEASE_NOTES Loading commit data...
TODO Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...
install-sh Loading commit data...