diff options
author | Yasuhiro Horimoto <iddqsar888plekww@gmail.com> | 2018-09-30 23:13:16 +0900 |
---|---|---|
committer | Yasuhiro Horimoto <iddqsar888plekww@gmail.com> | 2018-09-30 23:20:14 +0900 |
commit | aa8249d177cbac4a3c08348ea6dbe12d6526928d (patch) | |
tree | d6fbdf43025ad53c14fdfbf1c5db4ee3dcc5e799 /lib | |
parent | 99a874cc8af70db58da0f3e5e00c318488c6c3ea (diff) | |
download | Nim-aa8249d177cbac4a3c08348ea6dbe12d6526928d.tar.gz |
Fix #9126: use splitPath instead of substr
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/os.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 5c7d369c9..fabac8d95 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 = splitPath(path).tail case kind of pcFile: copyFile(path, dest / noSource) @@ -1232,7 +1232,7 @@ proc copyDirWithPermissions*(source, dest: string, if not ignorePermissionErrors: raise for kind, path in walkDir(source): - var noSource = path.substr(source.len()+1) + var noSource = splitPath(path).tail case kind of pcFile: copyFileWithPermissions(path, dest / noSource, ignorePermissionErrors) |