applies #322 without FReadDir effect

This commit is contained in:
Araq
2013-02-22 01:18:20 +01:00
parent d1d20e5760
commit 180ab350dc
2 changed files with 9 additions and 1 deletions

1
.gitignore vendored
View File

@@ -16,6 +16,7 @@ compiler/c2nim/nimcache
compiler/pas2nim/nimcache
misc
doc/*.html
doc/*.pdf
doc/*.idx
/web/upload
koch

View File

@@ -1103,8 +1103,15 @@ proc createDir*(dir: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} =
## The full path is created. If this fails, `EOS` is raised. It does **not**
## fail if the path already exists because for most usages this does not
## indicate an error.
var omitNext = false
when defined(doslike):
omitNext = isAbsolute(dir)
for i in 1.. dir.len-1:
if dir[i] in {dirsep, altsep}: rawCreateDir(substr(dir, 0, i-1))
if dir[i] in {dirsep, altsep}:
if omitNext:
omitNext = false
else:
rawCreateDir(substr(dir, 0, i-1))
rawCreateDir(dir)
proc copyDir*(source, dest: string) {.rtl, extern: "nos$1",