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
222d057c
Commit
222d057c
authored
Sep 19, 2011
by
Paul Betts
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create cross-platform setenv
parent
71a4c1f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
src/unix/posix.h
+1
-0
src/win32/posix.c
+8
-0
src/win32/posix.h
+1
-0
No files found.
src/unix/posix.h
View file @
222d057c
...
...
@@ -20,5 +20,6 @@
#define p_vsnprintf(b, c, f, a) vsnprintf(b, c, f, a)
#define p_snprintf(b, c, f, ...) snprintf(b, c, f, __VA_ARGS__)
#define p_mkstemp(p) mkstemp(p)
#define p_setenv(n,v,o) setenv(n,v,o)
#endif
src/win32/posix.c
View file @
222d057c
...
...
@@ -252,3 +252,11 @@ int p_mkstemp(char *tmp_path)
return
p_creat
(
tmp_path
,
0744
);
}
int
p_setenv
(
const
char
*
name
,
const
char
*
value
,
int
overwrite
)
{
if
(
overwrite
!=
1
)
return
EINVAL
;
return
(
SetEnvironmentVariableA
(
name
,
value
)
==
0
?
GIT_EOSERR
:
GIT_SUCCESS
);
}
src/win32/posix.h
View file @
222d057c
...
...
@@ -32,5 +32,6 @@ extern char *p_realpath(const char *orig_path, char *buffer);
extern
int
p_vsnprintf
(
char
*
buffer
,
size_t
count
,
const
char
*
format
,
va_list
argptr
);
extern
int
p_snprintf
(
char
*
buffer
,
size_t
count
,
const
char
*
format
,
...)
GIT_FORMAT_PRINTF
(
3
,
4
);
extern
int
p_mkstemp
(
char
*
tmp_path
);
extern
int
p_setenv
(
const
char
*
name
,
const
char
*
value
,
int
overwrite
);
#endif
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