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
758f2f10
Commit
758f2f10
authored
Nov 27, 2013
by
Alessandro Ghedini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
posix: Solaris doesn't have strnlen either
parent
a2e873d1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/posix.h
+6
-1
src/win32/mingw-compat.h
+0
-5
No files found.
src/posix.h
View file @
758f2f10
...
...
@@ -89,7 +89,12 @@ extern struct tm * p_gmtime_r (const time_t *timer, struct tm *result);
# include "unix/posix.h"
#endif
#ifndef __MINGW32__
#if defined(__MINGW32__) || defined(__sun)
GIT_INLINE
(
size_t
)
p_strnlen
(
const
char
*
s
,
size_t
maxlen
)
{
const
char
*
end
=
memchr
(
s
,
0
,
maxlen
);
return
end
?
(
size_t
)(
end
-
s
)
:
maxlen
;
}
#else
# define p_strnlen strnlen
#endif
...
...
src/win32/mingw-compat.h
View file @
758f2f10
...
...
@@ -19,11 +19,6 @@
# define S_IFLNK _S_IFLNK
# define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK)
GIT_INLINE
(
size_t
)
p_strnlen
(
const
char
*
s
,
size_t
maxlen
)
{
const
char
*
end
=
memchr
(
s
,
0
,
maxlen
);
return
end
?
(
size_t
)(
end
-
s
)
:
maxlen
;
}
#endif
#endif
/* INCLUDE_mingw_compat__ */
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