Skip to content

Commit e9b0cfc

Browse files
authored
Merge pull request libgit2#5485 from libgit2/ethomson/sysdir_unused
sysdir: remove unused git_sysdir_get_str
2 parents e56d48b + b6f18db commit e9b0cfc

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

src/sysdir.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -216,25 +216,6 @@ int git_sysdir_get(const git_buf **out, git_sysdir_t which)
216216
return 0;
217217
}
218218

219-
int git_sysdir_get_str(
220-
char *out,
221-
size_t outlen,
222-
git_sysdir_t which)
223-
{
224-
const git_buf *path = NULL;
225-
226-
GIT_ERROR_CHECK_ERROR(git_sysdir_check_selector(which));
227-
GIT_ERROR_CHECK_ERROR(git_sysdir_get(&path, which));
228-
229-
if (!out || path->size >= outlen) {
230-
git_error_set(GIT_ERROR_NOMEMORY, "buffer is too short for the path");
231-
return GIT_EBUFS;
232-
}
233-
234-
git_buf_copy_cstr(out, outlen, path);
235-
return 0;
236-
}
237-
238219
#define PATH_MAGIC "$PATH"
239220

240221
int git_sysdir_set(git_sysdir_t which, const char *search_path)

src/sysdir.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,6 @@ extern int git_sysdir_global_init(void);
9393
*/
9494
extern int git_sysdir_get(const git_buf **out, git_sysdir_t which);
9595

96-
/**
97-
* Get search path into a preallocated buffer
98-
*
99-
* @param out String buffer to write into
100-
* @param outlen Size of string buffer
101-
* @param which Which search path to return
102-
* @return 0 on success, GIT_EBUFS if out is too small, <0 on other failure
103-
*/
104-
105-
extern int git_sysdir_get_str(char *out, size_t outlen, git_sysdir_t which);
106-
10796
/**
10897
* Set search paths for global/system/xdg files
10998
*

0 commit comments

Comments
 (0)