about summary refs log tree commit diff stats
path: root/ranger/core/actions.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-02 19:28:02 +0200
committerhut <hut@lavabit.com>2011-10-02 19:28:02 +0200
commit4a04a9530d77c78c3574bb8b320f7ea3f163b13f (patch)
tree7c175019e2b8c739b4d03fe322d0d3f2a69b1ee6 /ranger/core/actions.py
parentf7894a1583f82e1ba97d0aefcbc19cf1bf1fc936 (diff)
downloadranger-4a04a9530d77c78c3574bb8b320f7ea3f163b13f.tar.gz
core.actions: sanitize input of {set,enter,unset}_bookmark
Diffstat (limited to 'ranger/core/actions.py')
-rw-r--r--ranger/core/actions.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 15e6dd74..0dd7686c 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -516,10 +516,10 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		"""Enter the bookmark with the name <key>"""
 		try:
 			self.bookmarks.update_if_outdated()
-			destination = self.bookmarks[key]
+			destination = self.bookmarks[str(key)]
 			cwd = self.env.cwd
 			if destination.path != cwd.path:
-				self.bookmarks.enter(key)
+				self.bookmarks.enter(str(key))
 				self.bookmarks.remember(cwd)
 		except KeyError:
 			pass
@@ -527,12 +527,12 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 	def set_bookmark(self, key):
 		"""Set the bookmark with the name <key> to the current directory"""
 		self.bookmarks.update_if_outdated()
-		self.bookmarks[key] = self.env.cwd
+		self.bookmarks[str(key)] = self.env.cwd
 
 	def unset_bookmark(self, key):
 		"""Delete the bookmark with the name <key>"""
 		self.bookmarks.update_if_outdated()
-		self.bookmarks.delete(key)
+		self.bookmarks.delete(str(key))
 
 	def draw_bookmarks(self):
 		self.ui.browser.draw_bookmarks = True