[glib] glib-compile-schemas: improve error accuracy



commit bd290081ff8c7951c6509d0aee23246739a928a2
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon Sep 27 10:36:11 2010 -0400

    glib-compile-schemas: improve error accuracy
    
    We wrote "<enum> must contain at least one <value>" for empty <flags>.
    Fix that.

 gio/glib-compile-schemas.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
index 95770a7..977c711 100644
--- a/gio/glib-compile-schemas.c
+++ b/gio/glib-compile-schemas.c
@@ -135,9 +135,10 @@ enum_state_end (EnumState **state_ptr,
   *state_ptr = NULL;
 
   if (state->strinfo->len == 0)
-    g_set_error_literal (error,
-                         G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
-                         "<enum> must contain at least one <value>");
+    g_set_error (error,
+                 G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+                 "<%s> must contain at least one <value>",
+                 state->is_flags ? "flags" : "enum");
 }
 
 /* Handling of <key> {{{1 */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]