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
c6ba8a37
Commit
c6ba8a37
authored
Aug 02, 2014
by
Linquize
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Can read large file larger than 2GB on Windows
parent
59403f1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
src/posix.c
+3
-4
src/posix.h
+1
-1
No files found.
src/posix.c
View file @
c6ba8a37
...
...
@@ -151,15 +151,14 @@ int p_rename(const char *from, const char *to)
#endif
/* GIT_WIN32 */
in
t
p_read
(
git_file
fd
,
void
*
buf
,
size_t
cnt
)
ssize_
t
p_read
(
git_file
fd
,
void
*
buf
,
size_t
cnt
)
{
char
*
b
=
buf
;
while
(
cnt
)
{
ssize_t
r
;
#ifdef GIT_WIN32
assert
((
size_t
)((
unsigned
int
)
cnt
)
==
cnt
);
r
=
read
(
fd
,
b
,
(
unsigned
int
)
cnt
);
r
=
read
(
fd
,
b
,
cnt
>
INT_MAX
?
INT_MAX
:
(
unsigned
int
)
cnt
);
#else
r
=
read
(
fd
,
b
,
cnt
);
#endif
...
...
@@ -173,7 +172,7 @@ int p_read(git_file fd, void *buf, size_t cnt)
cnt
-=
r
;
b
+=
r
;
}
return
(
int
)(
b
-
(
char
*
)
buf
);
return
(
b
-
(
char
*
)
buf
);
}
int
p_write
(
git_file
fd
,
const
void
*
buf
,
size_t
cnt
)
...
...
src/posix.h
View file @
c6ba8a37
...
...
@@ -97,7 +97,7 @@ typedef int git_file;
* Use your manpages to check the docs on these.
*/
extern
in
t
p_read
(
git_file
fd
,
void
*
buf
,
size_t
cnt
);
extern
ssize_
t
p_read
(
git_file
fd
,
void
*
buf
,
size_t
cnt
);
extern
int
p_write
(
git_file
fd
,
const
void
*
buf
,
size_t
cnt
);
#define p_close(fd) close(fd)
...
...
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