Skip to content

Commit 258701f

Browse files
committed
Don't add slash to start of path patterns on Windows
1 parent 4f393f3 commit 258701f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/extractor/semmle/projectlayout.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def __init__(self, path, line, virtual=None):
257257
exclude = path
258258
self._line = line;
259259
self._original = u'-' + exclude;
260-
if not exclude.startswith(u"/"):
260+
if os.name != 'nt' and not exclude.startswith(u"/"):
261261
exclude = u'/' + exclude
262262
if exclude.find(u"//") != -1:
263263
raise _error(u"Illegal '//' in exclude path", line)
@@ -274,14 +274,14 @@ def __init__(self, path, line, virtual=None):
274274
include = path
275275
self._line = line;
276276
self._original = include;
277-
if not include.startswith(u"/"):
277+
if os.name != 'nt' and not include.startswith(u"/"):
278278
include = u'/' + include
279279
doubleslash = include.find(u"//")
280280
if doubleslash != include.find(u"//"):
281281
raise _error(u"More than one '//' in include path (project-layout)", line)
282282
if self._verify_stars.match(include):
283283
raise _error(u"Illegal use of '**' in include path (project-layout)", line)
284-
if not virtual.startswith(u"/"):
284+
if os.name != 'nt' and not virtual.startswith(u"/"):
285285
virtual = u"/" + virtual
286286
if virtual.endswith(u"/"):
287287
virtual = virtual[0 : -1]

0 commit comments

Comments
 (0)