Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d71e47c

Browse files
committed
fix regarding dirnames in Feature #110
1 parent 2eb24c6 commit d71e47c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/request/basic.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import re
2828
import StringIO
2929
import zlib
30+
import ntpath
31+
import posixpath
3032

3133
from lib.core.data import conf
3234
from lib.core.data import kb
@@ -77,7 +79,11 @@ def parseResponse(page, headers):
7779
absFilePath = match.group("result")
7880

7981
if absFilePath not in kb.absFilePaths:
80-
kb.absFilePaths.add(os.path.dirname(absFilePath))
82+
if absFilePath.find('/') != -1:
83+
dirname = posixpath.dirname(absFilePath)
84+
else:
85+
dirname = ntpath.dirname(absFilePath)
86+
kb.absFilePaths.add(dirname)
8187

8288
def decodePage(page, encoding):
8389
"""

0 commit comments

Comments
 (0)