summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/pure/os.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index 5c7d369c9..b5fc2da3e 100644
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -1048,7 +1048,7 @@ proc copyDir*(source, dest: string) {.rtl, extern: "nos$1",
   ## these platforms use `copyDirWithPermissions() <#copyDirWithPermissions>`_.
   createDir(dest)
   for kind, path in walkDir(source):
-    var noSource = path.substr(source.len()+1)
+    var noSource = path.substr(source.len)
     case kind
     of pcFile:
       copyFile(path, dest / noSource)