[glib] glib-compile-schemas: Show error positions



commit aecac6e1cb80b3b5e64459f5a8536ad93d021c1b
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 15 22:41:29 2015 -0400

    glib-compile-schemas: Show error positions
    
    GMarkup provides this information, pass it on.

 gio/glib-compile-schemas.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
index 2b3e0de..31161fb 100644
--- a/gio/glib-compile-schemas.c
+++ b/gio/glib-compile-schemas.c
@@ -1745,6 +1745,7 @@ parse_gschema_files (gchar    **files,
       GMarkupParseContext *context;
       gchar *contents;
       gsize size;
+      gint line, col;
 
       if (!g_file_get_contents (filename, &contents, &size, &error))
         {
@@ -1776,7 +1777,8 @@ parse_gschema_files (gchar    **files,
             g_hash_table_remove (state.enum_table, item->data);
 
           /* let them know */
-          fprintf (stderr, "%s: %s.  ", filename, error->message);
+          g_markup_parse_context_get_position (context, &line, &col);
+          fprintf (stderr, "%s:%d:%d  %s.  ", filename, line, col, error->message);
           g_clear_error (&error);
 
           if (strict)


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