From d71e47ce566a1027d5927d784efda5ebdccbee27 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 4 Jan 2010 12:39:07 +0000 Subject: [PATCH] fix regarding dirnames in Feature #110 --- lib/request/basic.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/request/basic.py b/lib/request/basic.py index 2bf8a8b80..abbaabb25 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -27,6 +27,8 @@ import os import re import StringIO import zlib +import ntpath +import posixpath from lib.core.data import conf from lib.core.data import kb @@ -77,7 +79,11 @@ def parseResponse(page, headers): absFilePath = match.group("result") if absFilePath not in kb.absFilePaths: - kb.absFilePaths.add(os.path.dirname(absFilePath)) + if absFilePath.find('/') != -1: + dirname = posixpath.dirname(absFilePath) + else: + dirname = ntpath.dirname(absFilePath) + kb.absFilePaths.add(dirname) def decodePage(page, encoding): """