Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ca7a1139
Commit
ca7a1139
authored
Nov 21, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Factor out env_get_index helper.
parent
52b88199
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
environ.c
dlls/msvcrt/environ.c
+17
-14
No files found.
dlls/msvcrt/environ.c
View file @
ca7a1139
...
...
@@ -25,25 +25,28 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
msvcrt
);
static
char
*
getenv_helper
(
const
char
*
name
)
static
int
env_get_index
(
const
char
*
name
)
{
char
**
env
;
size_t
len
;
int
i
,
len
;
if
(
!
name
)
return
NULL
;
len
=
strlen
(
name
);
for
(
env
=
MSVCRT__environ
;
*
env
;
env
++
)
for
(
i
=
0
;
MSVCRT__environ
[
i
];
i
++
)
{
char
*
str
=
*
env
;
char
*
pos
=
strchr
(
str
,
'='
);
if
(
pos
&&
((
pos
-
str
)
==
len
)
&&
!
_strnicmp
(
str
,
name
,
len
))
{
TRACE
(
"(%s): got %s
\n
"
,
debugstr_a
(
name
),
debugstr_a
(
pos
+
1
));
return
pos
+
1
;
}
if
(
!
strncmp
(
name
,
MSVCRT__environ
[
i
],
len
)
&&
MSVCRT__environ
[
i
][
len
]
==
'='
)
return
i
;
}
return
NULL
;
return
i
;
}
static
char
*
getenv_helper
(
const
char
*
name
)
{
int
idx
;
if
(
!
name
)
return
NULL
;
idx
=
env_get_index
(
name
);
if
(
!
MSVCRT__environ
[
idx
])
return
NULL
;
return
strchr
(
MSVCRT__environ
[
idx
],
'='
)
+
1
;
}
/*********************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment