summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/fsobject/fsobject.py7
-rw-r--r--ranger/gui/widgets/statusbar.py3
2 files changed, 5 insertions, 5 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index f2f440c1..516f02e6 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -76,7 +76,7 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 		self.basename = basename(path)
 		self.basename_lower = self.basename.lower()
 		self.dirname = dirname(path)
-		self.realpath = realpath(path)
+		self.realpath = self.path
 
 		try:
 			lastdot = self.basename.rindex('.') + 1
@@ -172,6 +172,8 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 			self.is_link = stat.S_ISLNK(self.stat.st_mode)
 			if self.is_link:
 				try: # try to resolve the link
+					self.readlink = os.readlink(self.path)
+					self.realpath = realpath(self.path)
 					self.stat = os.stat(self.path)
 				except:  # it failed, so it must be a broken link
 					pass
@@ -219,9 +221,6 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 			self.exists = False
 			self.runnable = False
 
-		if self.is_link:
-			self.readlink = os.readlink(self.path)
-
 	def get_permission_string(self):
 		if self.permissions is not None:
 			return self.permissions
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py
index 52425943..bff3d8ad 100644
--- a/ranger/gui/widgets/statusbar.py
+++ b/ranger/gui/widgets/statusbar.py
@@ -164,7 +164,8 @@ class StatusBar(Widget):
 
 		if target.is_link:
 			how = target.exists and 'good' or 'bad'
-			left.add(' -> ' + target.readlink, 'link', how)
+			dest = target.readlink if target.readlink is not None else '?'
+			left.add(' -> ' + dest, 'link', how)
 		else:
 			if self.settings.display_size_in_status_bar and target.infostring:
 				left.add(target.infostring)
ted pydoc documentation' href='/akspecs/ranger/commit/doc/pydoc/test.tc_keyapi.html?h=v1.5.3&id=4c13e1f2d85483e026d79ab05da9f1e8e4b45293'>4c13e1f2 ^
34a60763 ^
4c13e1f2 ^





34a60763 ^
4c13e1f2 ^





34a60763 ^
4c13e1f2 ^

34a60763 ^
4c13e1f2 ^

34a60763 ^
4c13e1f2 ^
34a60763 ^
4c13e1f2 ^





34a60763 ^
4c13e1f2 ^





34a60763 ^
4c13e1f2 ^

34a60763 ^
4c13e1f2 ^

34a60763 ^
4c13e1f2 ^



34a60763 ^
4c13e1f2 ^
34a60763 ^
4c13e1f2 ^
34a60763 ^
4c13e1f2 ^






4c13e1f2 ^

34a60763 ^
4c13e1f2 ^
34a60763 ^





4c13e1f2 ^
34a60763 ^

4c13e1f2 ^
34a60763 ^
4c13e1f2 ^
34a60763 ^





4c13e1f2 ^
34a60763 ^

4c13e1f2 ^
34a60763 ^





4c13e1f2 ^






34a60763 ^

4c13e1f2 ^
34a60763 ^

4c13e1f2 ^












34a60763 ^
4c13e1f2 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194