mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-22 08:51:21 +00:00
some little bugfixes
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user