From c9c44a4eb9d294ca1a0fe36e964536431b198035 Mon Sep 17 00:00:00 2001 From: oskca Date: Thu, 11 Jan 2018 19:42:19 +0800 Subject: correct type for raiseOSError --- lib/pure/os.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 1e3224537..9d6dc4f80 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -675,7 +675,7 @@ template walkCommon(pattern: string, filter) = if findNextFile(res, f) == 0'i32: let errCode = getLastError() if errCode == ERROR_NO_MORE_FILES: break - else: raiseOSError(errCode, "findNextFile failed") + else: raiseOSError(errCode.OSErrorCode, "findNextFile failed") else: # here we use glob var f: Glob @@ -785,10 +785,10 @@ iterator walkDir*(dir: string; relative=false): tuple[kind: PathComponent, path: let xx = if relative: extractFilename(getFilename(f)) else: dir / extractFilename(getFilename(f)) yield (k, xx) - if findNextFile(res, f) == 0'i32: + if findNextFile(h, f) == 0'i32: let errCode = getLastError() if errCode == ERROR_NO_MORE_FILES: break - else: raiseOSError(errCode, "findNextFile failed") + else: raiseOSError(errCode.OSErrorCode, "findNextFile failed") else: var d = opendir(dir) if d != nil: -- cgit 1.4.1-2-gfad0