Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/util/errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
9 changes: 5 additions & 4 deletions src/util/fs_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/util/futils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_SHA1_SIZE],
unsigned char checksum[GIT_HASH_SHA256_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);
Expand Down
2 changes: 1 addition & 1 deletion src/util/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/util/regexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/util/unix/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down