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
175c6fb0
Unverified
Commit
175c6fb0
authored
Dec 14, 2023
by
Edward Thomson
Committed by
GitHub
Dec 14, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6659 from boretrk/fixwarn
util: suppress some uninitialized variable warnings
parents
aea6eaf8
bde119e7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
8 deletions
+12
-8
src/util/errors.c
+3
-0
src/util/fs_path.c
+5
-4
src/util/futils.h
+1
-1
src/util/net.c
+1
-1
src/util/regexp.c
+1
-1
src/util/unix/process.c
+1
-1
No files found.
src/util/errors.c
View file @
175c6fb0
...
...
@@ -376,6 +376,9 @@ void git_error_system_set(int code)
/* Deprecated error values and functions */
#ifndef GIT_DEPRECATE_HARD
#include "git2/deprecated.h"
const
git_error
*
giterr_last
(
void
)
{
return
git_error_last
();
...
...
src/util/fs_path.c
View file @
175c6fb0
...
...
@@ -1938,12 +1938,13 @@ static int sudo_uid_lookup(uid_t *out)
{
git_str
uid_str
=
GIT_STR_INIT
;
int64_t
uid
;
int
error
;
int
error
=
-
1
;
if
(
(
error
=
git__getenv
(
&
uid_str
,
"SUDO_UID"
)
)
==
0
&&
(
error
=
git__strntol64
(
&
uid
,
uid_str
.
ptr
,
uid_str
.
size
,
NULL
,
10
)
)
==
0
&&
uid
==
(
int64_t
)((
uid_t
)
uid
))
{
if
(
git__getenv
(
&
uid_str
,
"SUDO_UID"
)
==
0
&&
git__strntol64
(
&
uid
,
uid_str
.
ptr
,
uid_str
.
size
,
NULL
,
10
)
==
0
&&
uid
==
(
int64_t
)((
uid_t
)
uid
))
{
*
out
=
(
uid_t
)
uid
;
error
=
0
;
}
git_str_dispose
(
&
uid_str
);
...
...
src/util/futils.h
View file @
175c6fb0
...
...
@@ -25,7 +25,7 @@ extern int git_futils_readbuffer(git_str *obj, const char *path);
extern
int
git_futils_readbuffer_updated
(
git_str
*
obj
,
const
char
*
path
,
unsigned
char
checksum
[
GIT_HASH_SHA
1
_SIZE
],
unsigned
char
checksum
[
GIT_HASH_SHA
256
_SIZE
],
int
*
updated
);
extern
int
git_futils_readbuffer_fd_full
(
git_str
*
obj
,
git_file
fd
);
extern
int
git_futils_readbuffer_fd
(
git_str
*
obj
,
git_file
fd
,
size_t
len
);
...
...
src/util/net.c
View file @
175c6fb0
...
...
@@ -657,7 +657,7 @@ static bool has_at(const char *str)
int
git_net_url_parse_scp
(
git_net_url
*
url
,
const
char
*
given
)
{
const
char
*
default_port
=
default_port_for_scheme
(
"ssh"
);
const
char
*
c
,
*
user
,
*
host
,
*
port
,
*
path
=
NULL
;
const
char
*
c
,
*
user
,
*
host
,
*
port
=
NULL
,
*
path
=
NULL
;
size_t
user_len
=
0
,
host_len
=
0
,
port_len
=
0
;
unsigned
short
bracket
=
0
;
...
...
src/util/regexp.c
View file @
175c6fb0
...
...
@@ -125,7 +125,7 @@ int git_regexp_search(const git_regexp *r, const char *string, size_t nmatches,
if
((
data
=
pcre2_match_data_create
(
nmatches
,
NULL
))
==
NULL
)
{
git_error_set_oom
();
goto
out
;
return
-
1
;
}
if
((
error
=
pcre2_match
(
*
r
,
(
const
unsigned
char
*
)
string
,
strlen
(
string
),
...
...
src/util/unix/process.c
View file @
175c6fb0
...
...
@@ -37,7 +37,7 @@ struct git_process {
GIT_INLINE
(
bool
)
is_delete_env
(
const
char
*
env
)
{
char
*
c
=
index
(
env
,
'='
);
char
*
c
=
strchr
(
env
,
'='
);
if
(
c
==
NULL
)
return
false
;
...
...
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