Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
7d3d98eb
Commit
7d3d98eb
authored
Sep 21, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implement _wsearchenv.
parent
7de0f1d5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
1 deletion
+65
-1
dir.c
dlls/msvcrt/dir.c
+63
-0
msvcrt.h
dlls/msvcrt/msvcrt.h
+1
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
No files found.
dlls/msvcrt/dir.c
View file @
7d3d98eb
...
...
@@ -1010,3 +1010,66 @@ void CDECL _searchenv(const char* file, const char* env, char *buf)
penv
=
*
end
?
end
+
1
:
end
;
}
while
(
1
);
}
/*********************************************************************
* _wsearchenv (MSVCRT.@)
*
* Unicode version of _searchenv
*/
void
CDECL
_wsearchenv
(
const
MSVCRT_wchar_t
*
file
,
const
MSVCRT_wchar_t
*
env
,
MSVCRT_wchar_t
*
buf
)
{
MSVCRT_wchar_t
*
envVal
,
*
penv
;
MSVCRT_wchar_t
curPath
[
MAX_PATH
];
*
buf
=
'\0'
;
/* Try CWD first */
if
(
GetFileAttributesW
(
file
)
!=
INVALID_FILE_ATTRIBUTES
)
{
GetFullPathNameW
(
file
,
MAX_PATH
,
buf
,
NULL
);
/* Sigh. This error is *always* set, regardless of success */
msvcrt_set_errno
(
ERROR_FILE_NOT_FOUND
);
return
;
}
/* Search given environment variable */
envVal
=
_wgetenv
(
env
);
if
(
!
envVal
)
{
msvcrt_set_errno
(
ERROR_FILE_NOT_FOUND
);
return
;
}
penv
=
envVal
;
TRACE
(
":searching for %s in paths %s
\n
"
,
debugstr_w
(
file
),
debugstr_w
(
envVal
));
do
{
MSVCRT_wchar_t
*
end
=
penv
;
while
(
*
end
&&
*
end
!=
';'
)
end
++
;
/* Find end of next path */
if
(
penv
==
end
||
!*
penv
)
{
msvcrt_set_errno
(
ERROR_FILE_NOT_FOUND
);
return
;
}
memcpy
(
curPath
,
penv
,
(
end
-
penv
)
*
sizeof
(
MSVCRT_wchar_t
));
if
(
curPath
[
end
-
penv
]
!=
'/'
||
curPath
[
end
-
penv
]
!=
'\\'
)
{
curPath
[
end
-
penv
]
=
'\\'
;
curPath
[
end
-
penv
+
1
]
=
'\0'
;
}
else
curPath
[
end
-
penv
]
=
'\0'
;
strcatW
(
curPath
,
file
);
TRACE
(
"Checking for file %s
\n
"
,
debugstr_w
(
curPath
));
if
(
GetFileAttributesW
(
curPath
)
!=
INVALID_FILE_ATTRIBUTES
)
{
strcpyW
(
buf
,
curPath
);
msvcrt_set_errno
(
ERROR_FILE_NOT_FOUND
);
return
;
/* Found */
}
penv
=
*
end
?
end
+
1
:
end
;
}
while
(
1
);
}
dlls/msvcrt/msvcrt.h
View file @
7d3d98eb
...
...
@@ -651,6 +651,7 @@ int MSVCRT__close(int);
int
MSVCRT__dup
(
int
);
int
MSVCRT__dup2
(
int
,
int
);
int
MSVCRT__pipe
(
int
*
,
unsigned
int
,
int
);
MSVCRT_wchar_t
*
_wgetenv
(
const
MSVCRT_wchar_t
*
);
#endif
#endif
/* __WINE_MSVCRT_H */
dlls/msvcrt/msvcrt.spec
View file @
7d3d98eb
...
...
@@ -552,7 +552,7 @@
@ cdecl _wrename(wstr wstr)
@ cdecl _write(long ptr long) MSVCRT__write
@ cdecl _wrmdir(wstr)
@ st
ub _wsearchenv #
(wstr wstr ptr)
@ st
dcall _wsearchenv
(wstr wstr ptr)
@ cdecl _wsetlocale(long wstr) MSVCRT__wsetlocale
@ varargs _wsopen (wstr long long) MSVCRT__wsopen
@ stub _wspawnl #(long wstr wstr) varargs
...
...
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