[gnome-builder] libide: fail if no .editorconfig setting was found



commit c3397345baa496038b668a0486dc8cb7601f08de
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]