summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2014-08-22 23:38:21 +0200
committerhut <hut@lepus.uberspace.de>2014-08-22 23:38:21 +0200
commit8a289dd26b9474639e6c004df80fe19532ca54f7 (patch)
treed7ec4f91544998c28b8fcc7f9ad88ef00afb7f13 /ranger
parenta9fd41af92a0c13bc178e39fc957b4953a0d4483 (diff)
downloadranger-8a289dd26b9474639e6c004df80fe19532ca54f7.tar.gz
fix sorting by size in some corner case
see https://savannah.nongnu.org/bugs/index.php?42736
Diffstat (limited to 'ranger')
-rw-r--r--ranger/container/directory.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index 136cc8ac..07b2192d 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -77,7 +77,7 @@ class Directory(FileSystemObject, Accumulator, Loadable):
     sort_dict = {
         'basename': sort_by_basename,
         'natural': sort_naturally,
-        'size': lambda path: -path.size,
+        'size': lambda path: -(path.size or 1),
         'mtime': lambda path: -(path.stat and path.stat.st_mtime or 1),
         'ctime': lambda path: -(path.stat and path.stat.st_ctime or 1),
         'atime': lambda path: -(path.stat and path.stat.st_atime or 1),