summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2014-08-30 12:57:42 +0100
committerDominik Picheta <dominikpicheta@googlemail.com>2014-08-30 12:57:42 +0100
commitfb4e54442bc9097acd8fbef5023694884aad3ea4 (patch)
treecfa3bc7e397d62573d78f4749e7e5c8933f28f62
parent4a7a47f294314203b66af19b5219ecbb272e3c0b (diff)
downloadNim-fb4e54442bc9097acd8fbef5023694884aad3ea4.tar.gz
Fixed issue with os module in non-unicode mode on Windows.
-rw-r--r--lib/pure/os.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index c4b694406..8227c92b2 100644
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -2013,7 +2013,10 @@ proc isHidden*(path: string): bool =
   ## On Unix-like systems, a file is hidden if it starts with a '.' (period)
   ## and is not *just* '.' or '..' ' ."
   when defined(Windows):
-    wrapUnary(attributes, getFileAttributesW, path)
+    when useWinUnicode:
+      wrapUnary(attributes, getFileAttributesW, path)
+    else:
+      var attributes = getFileAttributesA(path)
     if attributes != -1'i32:
       result = (attributes and FILE_ATTRIBUTE_HIDDEN) != 0'i32
   else: