Commits

Iñigo Serna committed b2ab950

Fixed bugs: rename/backup ".." crashes, don't compress ".."

* lfm/actions.py (rename): fix bug: rename/backup '..' crashes
* lfm/actions.py (backup_file):

* lfm/actions.py (file_menu): we should not compress '..'

  • Participants
  • Parent commits 599ccf8

Comments (0)

Files changed (3)

+Sun May  8 00:51:00 2011  Iñigo Serna  <inigoserna@gmail.com>
+
+	* lfm/actions.py (file_menu): we should not compress '..'
+
+Sun May  8 00:34:56 2011  Iñigo Serna  <inigoserna@gmail.com>
+
+	* lfm/actions.py (rename): fix bug: rename/backup '..' crashes
+	* lfm/actions.py (backup_file):
+
 Sun May  8 00:08:19 2011  Iñigo Serna  <inigoserna@gmail.com>
 
 	* lfm/messages.py (get_a_key): fix error in last commit
 ============================================================================
-Last update:	Time-stamp: <2011-03-08 23:33:06 inigo>
+Last update:	Time-stamp: <2011-05-08 00:52:26 inigo>
 ============================================================================
 
 - min. python v2.5? RHEL5 ships 2.4, but it was released in sept 2006
 
 Bugs:
 =====
-- rename pardir: crash
 - show filesystem: ellipsize_middle if len(fs_name) > 22
 - find files: if results contain dir_with_spaces
 - "try: except Exception as", only python v2.6+
     . when number of lines == window height
   . copy/move "/file" to "/anydir/anyplace" fails, trying to copy/move to "/"
   . 'lfm' shell function: change "$*" to "$@" to properly handle pathscontaing spaces
+  . ncurses 5.8 doesn't accept 0 as width or height
+  . time string could contain non-ascii characters
+  . executing non-ascii programname or args
+  . convoluted issue with link to directory in corner cases
+  . rename/backup ".." crashes
+  . we should not compress ".."
 - DOCS:
-  . README FAQ: added information about fuse sshfs and curlftpfs
-  . mention python v2.4+
+  . README FAQ: added information about fuse ssh, ftp and webdav
+  . mention python v2.5+
   . reorganized and fixed key bindings section
 
 THANKS:

File lfm/actions.py

 
 def rename(tab):
     fs = __rename_backup_helper(tab)
+    if fs is None:
+        return
     res = ProcessLoopRename('Rename files', files.do_rename, fs, tab.path).run()
     tab.selections = []
     tab.refresh()
 
 def backup_file(tab):
     fs = __rename_backup_helper(tab)
+    if fs is None:
+        return
     try:
         # pc is not used, just to check files have valid encoding
         pc = files.PathContents(fs, tab.path)
     elif cmd == 'u':
         uncompress_dir(tab, app.noact_pane.act_tab.path)
     elif cmd == 'c':
+        if not tab.selections and os.path.basename(tab.sorted[tab.file_i])==os.pardir:
+            return
         compress_fmts = {'g': 'tgz', 'b': 'tbz2', 'x': 'txz',
                          'z': 'zip', 'r': 'rar', '7': '7z'}
         while True: