--- debugger.orig/debugger.py 2004-12-07 19:04:12.000000000 +0100 +++ debugger.py 2007-07-09 11:15:49.000000000 +0200 @@ -1,6 +1,7 @@ # -*- c--oding: ko_KR.UTF-8 -*- import os +import re import sys import vim import socket @@ -476,7 +477,11 @@ if file != self.file: self.file = file self.go_srcview() - vim.command('silent edit ' + file) + # Escape nasties with a \ (but only in the command and not in the + # original file name, which is used as the buffername + toEscape = re.compile('([ "\'])'); + escapedFile = toEscape.sub(r'\\\1', file); + vim.command('silent edit ' + escapedFile) vim.command('sign place ' + nextsign + ' name=current line='+str(line)+' file='+file) vim.command('sign unplace ' + self.cursign) @@ -732,6 +737,7 @@ """ file = res.firstChild.getAttribute('fileuri')[7:] + file = fixFileName(file) self.ui.set_srcview(file, 1) def handle_response_error(self, res): @@ -763,7 +769,7 @@ self.stacks = [] for s in stacks: - self.stacks.append( {'file': s.getAttribute('filename')[7:], \ + self.stacks.append( {'file': fixFileName(s.getAttribute('filename')[7:]), \ 'line': int(s.getAttribute('lineno')), \ 'where': s.getAttribute('where'), \ 'level': int(s.getAttribute('level')) @@ -1091,3 +1097,12 @@ 999 : """Unknown error """ \ } +import urllib +def fixFileName(fileName): + fileName = urllib.unquote(fileName) + if os.name=='nt' and fileName[0]=="/": + fileName = fileName[1:] # strip off initial slash char + + return fileName + +# vim: sw=2 ts=2 sts=2 expandtab: