summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-03-27 00:33:20 +0100
committerAraq <rumpf_a@web.de>2011-03-27 00:33:20 +0100
commitdc669155e39007f1b584eef247dff90523f836bf (patch)
tree5233362a6af2ac7232159ffebb7bfc19ea27026b /lib
parent45f8d31c4718fb20498b16a621f3d14b3056b5cc (diff)
downloadNim-dc669155e39007f1b584eef247dff90523f836bf.tar.gz
some little bugfixes
Diffstat (limited to 'lib')
-rwxr-xr-xlib/pure/os.nim7
-rwxr-xr-xlib/pure/pegs.nim2
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index 992b34c49..f7d22ca06 100755
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -699,7 +699,10 @@ when defined(windows):
       discard FreeEnvironmentStringsA(env)
 
 else:
-  when defined(macosx):
+  const
+    useNSGetEnviron = defined(macosx) and 
+      (defined(createNimRtl) or defined(useNimRtl))
+  when useNSGetEnviron:
     # From the manual:
     # Shared libraries and bundles don't have direct access to environ, 
     # which is only available to the loader ld(1) when a complete program
@@ -716,7 +719,7 @@ else:
   proc getEnvVarsC() =
     # retrieves the variables of char** env of C's main proc
     if not envComputed:
-      when defined(macosx):
+      when useNSGetEnviron:
         var gEnv = NSGetEnviron()^
       var i = 0
       while True:
diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim
index 6ad52c9a1..2e1d0f0ad 100755
--- a/lib/pure/pegs.nim
+++ b/lib/pure/pegs.nim
@@ -751,7 +751,7 @@ proc match*(s: string, pattern: TPeg, matches: var openarray[string],
   ## returned.
   var c: TCaptures
   c.origStart = start
-  result = rawMatch(s, pattern, start, c) == len(s) -start
+  result = rawMatch(s, pattern, start, c) == len(s) - start
   if result:
     for i in 0..c.ml-1:
       matches[i] = copy(s, c.matches[i][0], c.matches[i][1])