summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-05 05:39:11 +0100
committerhut <hut@lavabit.com>2013-02-05 05:39:35 +0100
commit6483b2f2c6d10c15cd6f1eab5fa4dc6b08e305d4 (patch)
tree95cdb8414a0283e0ab1afc7d05c7f3c1d2909a4f
parent9104df3870f4c05bad5e6de1f2a27e8306e839c0 (diff)
downloadranger-6483b2f2c6d10c15cd6f1eab5fa4dc6b08e305d4.tar.gz
fsobject.fsobject: fix handling of symlinks
When you deleted a symlink to a directory and created a normal directory
with the same name, it still appeared a symlink.  This commit fixes
that.
-rw-r--r--ranger/fsobject/fsobject.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index 073da74f..0417e8d3 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -210,8 +210,8 @@ class FileSystemObject(FileManagerAware):
 		else:
 			try:
 				new_stat = lstat(path)
-				is_link = new_stat.st_mode & 0o170000 == 0o120000
-				if is_link:
+				self.is_link = new_stat.st_mode & 0o170000 == 0o120000
+				if self.is_link:
 					new_stat = stat(path)
 				self.exists = True
 			except:
@@ -242,10 +242,8 @@ class FileSystemObject(FileManagerAware):
 			else:
 				self.size = 0
 				self.infostring = '?'
-		if is_link:
-			self.is_link = True
-			if not self.is_directory:
-				self.infostring = '->' + self.infostring
+		if self.is_link and not self.is_directory:
+			self.infostring = '->' + self.infostring
 
 		self.stat = new_stat