[libgit2-glib/wip/development] Fix ggit_config_find_system and ggit_config_find_global
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib/wip/development] Fix ggit_config_find_system and ggit_config_find_global
- Date: Sat, 26 Apr 2014 13:33:58 +0000 (UTC)
commit a2b5cadafb1b6cb38251e2447795ed13112fcdae
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sat Apr 26 15:32:22 2014 +0200
Fix ggit_config_find_system and ggit_config_find_global
libgit2-glib/ggit-config.c | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/libgit2-glib/ggit-config.c b/libgit2-glib/ggit-config.c
index 60a2fd0..fcf3d93 100644
--- a/libgit2-glib/ggit-config.c
+++ b/libgit2-glib/ggit-config.c
@@ -177,16 +177,16 @@ ggit_config_new_default (GError **error)
GFile *
ggit_config_find_global (void)
{
- gchar path[GIT_PATH_MAX];
+ git_buf buf;
+ GFile *path = NULL;
- if (git_config_find_global (path, GIT_PATH_MAX) != GIT_OK)
+ if (git_config_find_global (&buf) == GIT_OK)
{
- return NULL;
- }
- else
- {
- return g_file_new_for_path (path);
+ path = g_file_new_for_path (buf.ptr);
+ git_buf_free (&buf);
}
+
+ return path;
}
/**
@@ -206,16 +206,16 @@ ggit_config_find_global (void)
GFile *
ggit_config_find_system (void)
{
- gchar path[GIT_PATH_MAX];
+ git_buf buf;
+ GFile *path = NULL;
- if (git_config_find_system (path, GIT_PATH_MAX) != GIT_OK)
+ if (git_config_find_system (&buf) == GIT_OK)
{
- return NULL;
- }
- else
- {
- return g_file_new_for_path (path);
+ path = g_file_new_for_path (buf.ptr);
+ git_buf_free (&buf);
}
+
+ return path;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]