       (when (svn-status-line-info->is-visiblep (car st-info))
         (setq current-line (1+ current-line)))
       (setq i-fname (svn-status-line-info->filename (car st-info)))
-      (when (and (>= (length i-fname) (length file-name))
-                 (string= file-name (substring i-fname 0 (length file-name))))
+      (when (or (string= file-name i-fname)
+		(string-match sub-file-regexp i-fname))
         (when (svn-status-line-info->is-visiblep (car st-info))
           (when (or (not only-this-line) (string= file-name i-fname))
             (setq newcursorpos-fname i-fname)

  (let* ((st-info svn-status-info)
         (line-info (svn-status-get-line-information))
         (file-name (svn-status-line-info->filename line-info))
         (newcursorpos-fname)
         (i-fname)
         (current-line svn-start-of-file-list-line-number))

;; $Id$

;; psvn.el is free software; you can redistribute it and/or modify
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

