Skip to content

Commit

Permalink
Consider only the basename for ‘foo2bar’ aliases
Browse files Browse the repository at this point in the history
Previously, running unoconv from any location with exactly one ‘2’ in it
would fail.  This is a real problem on GNU Guix, where each package
directory is prefixed with an alphanumeric hash.

  $ …/a2b/unoconv <file>
  ‘unoconv: format [b/unoconv] is not known to unoconv.
  • Loading branch information
nckx committed Feb 21, 2020
1 parent c3ff893 commit 744439d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unoconv
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ class Options:
### If no format was specified, probe it or provide it
if not self.format:
### Check if the command is in the form odt2pdf
l = sys.argv[0].split('2')
l = os.path.basename(sys.argv[0]).split('2')
if len(l) == 2:
self.format = l[1]
### Use the extension of the output file
Expand Down

0 comments on commit 744439d

Please sign in to comment.