Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Glasgow Haskell Compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ömer Sinan Ağacan
Glasgow Haskell Compiler
Commits
5670881d
Commit
5670881d
authored
Feb 05, 2020
by
Tamar Christina
Committed by
Marge Bot
Feb 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fs: Fix UNC remapping code.
parent
f3e737bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
utils/fs/fs.c
utils/fs/fs.c
+6
-2
No files found.
utils/fs/fs.c
View file @
5670881d
...
@@ -91,12 +91,16 @@ wchar_t* FS(create_device_name) (const wchar_t* filename) {
...
@@ -91,12 +91,16 @@ wchar_t* FS(create_device_name) (const wchar_t* filename) {
free
(
temp
);
free
(
temp
);
int
startOffset
=
0
;
/* When remapping a network share, \\foo needs to become
\\?\UNC\foo and not \\?\\UNC\\foo which is an invalid path. */
if
(
wcsncmp
(
network_share
,
result
,
2
)
==
0
)
if
(
wcsncmp
(
network_share
,
result
,
2
)
==
0
)
{
{
if
(
swprintf
(
ns
,
10
,
L"%ls%ls"
,
win32_file_namespace
,
unc_prefix
)
<=
0
)
if
(
swprintf
(
ns
,
10
,
L"%ls%ls"
,
win32_file_namespace
,
unc_prefix
)
<=
0
)
{
{
goto
cleanup
;
goto
cleanup
;
}
}
startOffset
=
2
;
}
}
else
if
(
swprintf
(
ns
,
10
,
L"%ls"
,
win32_file_namespace
)
<=
0
)
else
if
(
swprintf
(
ns
,
10
,
L"%ls"
,
win32_file_namespace
)
<=
0
)
{
{
...
@@ -104,8 +108,8 @@ wchar_t* FS(create_device_name) (const wchar_t* filename) {
...
@@ -104,8 +108,8 @@ wchar_t* FS(create_device_name) (const wchar_t* filename) {
}
}
/* Create new string. */
/* Create new string. */
int
bLen
=
wcslen
(
result
)
+
wcslen
(
ns
)
+
1
;
int
bLen
=
wcslen
(
result
)
+
wcslen
(
ns
)
+
1
-
startOffset
;
temp
=
_wcsdup
(
result
);
temp
=
_wcsdup
(
result
+
startOffset
);
free
(
result
);
free
(
result
);
result
=
malloc
(
bLen
*
sizeof
(
wchar_t
));
result
=
malloc
(
bLen
*
sizeof
(
wchar_t
));
if
(
swprintf
(
result
,
bLen
,
L"%ls%ls"
,
ns
,
temp
)
<=
0
)
if
(
swprintf
(
result
,
bLen
,
L"%ls%ls"
,
ns
,
temp
)
<=
0
)
...
...
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