[gnome-builder/wip/libide] libide: fail if no .editorconfig setting was found
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide] libide: fail if no .editorconfig setting was found
- Date: Sun, 15 Feb 2015 05:09:52 +0000 (UTC)
commit e6bd6ab3d7a24b3d3755d7ef16e18b2467c732ae
Author: Christian Hergert <christian hergert me>
Date: Sat Feb 14 21:09:15 2015 -0800
libide: fail if no .editorconfig setting was found
libide/editorconfig/editorconfig-glib.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/libide/editorconfig/editorconfig-glib.c b/libide/editorconfig/editorconfig-glib.c
index c30a3c8..1f29a03 100644
--- a/libide/editorconfig/editorconfig-glib.c
+++ b/libide/editorconfig/editorconfig-glib.c
@@ -75,10 +75,19 @@ editorconfig_glib_read (GFile *file,
goto cleanup;
}
- ret = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, _g_value_free);
-
count = editorconfig_handle_get_name_value_count (handle);
+ if (!count)
+ {
+ g_set_error (error,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "no config options were found.");
+ goto cleanup;
+ }
+
+ ret = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, _g_value_free);
+
for (i = 0; i < count; i++)
{
GValue *value;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]