Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
5b62eb7d
Commit
5b62eb7d
authored
Feb 08, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1325 from SHyx0rmZ/fix-windows-symlinks
Fix Windows symlinks
parents
41713ec1
7672c8c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
src/win32/posix_w32.c
+18
-3
No files found.
src/win32/posix_w32.c
View file @
5b62eb7d
...
...
@@ -100,6 +100,21 @@ static int do_lstat(
buf
->
st_mtime
=
filetime_to_time_t
(
&
(
fdata
.
ftLastWriteTime
));
buf
->
st_ctime
=
filetime_to_time_t
(
&
(
fdata
.
ftCreationTime
));
/* Windows symlinks have zero file size, call readlink to determine
* the length of the path pointed to, which we expect everywhere else
*/
if
(
fMode
&
S_IFLNK
)
{
char
target
[
GIT_WIN_PATH
];
int
readlink_result
;
readlink_result
=
p_readlink
(
file_name
,
target
,
GIT_WIN_PATH
);
if
(
readlink_result
==
-
1
)
return
-
1
;
buf
->
st_size
=
strlen
(
target
);
}
return
0
;
}
...
...
@@ -157,10 +172,10 @@ int p_readlink(const char *link, char *target, size_t target_len)
* it is not available in platforms older than Vista
*/
if
(
pGetFinalPath
==
NULL
)
{
H
INSTANCE
library
=
LoadLibrary
(
"kernel32"
);
H
MODULE
module
=
GetModuleHandle
(
"kernel32"
);
if
(
library
!=
NULL
)
pGetFinalPath
=
(
fpath_func
)
GetProcAddress
(
library
,
"GetFinalPathNameByHandleW"
);
if
(
module
!=
NULL
)
pGetFinalPath
=
(
fpath_func
)
GetProcAddress
(
module
,
"GetFinalPathNameByHandleW"
);
if
(
pGetFinalPath
==
NULL
)
{
giterr_set
(
GITERR_OS
,
...
...
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