From 5744c13146e3401e479e58cca87d872423b046e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Wed, 22 Aug 2012 00:11:10 +0200 Subject: [PATCH] I think readlink only follows one level, this should get the canonical path (absolute and to the last level) --- ponysay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ponysay b/ponysay index afcc595b..f177ad37 100755 --- a/ponysay +++ b/ponysay @@ -257,7 +257,7 @@ class Ponysay(): if (len(pony) > 5) and (pony[-5:] == '.pony'): ponies.append(pony[:-5]) ponies.sort() - pairs = [(pony, os.readlink(ponydir + pony + '.pony') if os.path.islink(ponydir + pony + '.pony') else '') for pony in ponies] + pairs = [(pony, os.path.realpath(ponydir + pony + '.pony') if os.path.islink(ponydir + pony + '.pony') else '') for pony in ponies] ponymap = {} for pair in pairs: