[gnome-builder] autotools: don't skip parsing the last line



commit ef4e4b749efb6bb8fb0ed31cf72139336c006c0f
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Sun Feb 19 08:11:22 2017 +0530

    autotools: don't skip parsing the last line
    
    New targets where added only if the key doesn't end with "dir".
    So when parsing make output, if the end lines end with "dir" as key
    they are not added to targets. This caused missing bin dirs.
    
    This commit makes makecache not skip the processing of last line.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771145

 plugins/autotools/ide-makecache.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/plugins/autotools/ide-makecache.c b/plugins/autotools/ide-makecache.c
index 3dbae54..ca32361 100644
--- a/plugins/autotools/ide-makecache.c
+++ b/plugins/autotools/ide-makecache.c
@@ -1633,7 +1633,8 @@ ide_makecache_get_build_targets_worker (GTask        *task,
        */
       ide_line_reader_init (&reader, stdout_buf, -1);
 
-      while (NULL != (line = ide_line_reader_next (&reader, &line_len)))
+      line = ide_line_reader_next (&reader, &line_len);
+      while (line != NULL)
         {
           g_auto(GStrv) parts = NULL;
           g_auto(GStrv) names = NULL;
@@ -1643,6 +1644,8 @@ ide_makecache_get_build_targets_worker (GTask        *task,
 
           parts = g_strsplit (line, "=", 2);
 
+          line = ide_line_reader_next (&reader, &line_len);
+
           if (!parts[0] || !parts[1] || !*parts[1])
             continue;
 
@@ -1654,7 +1657,8 @@ ide_makecache_get_build_targets_worker (GTask        *task,
           if (g_str_has_suffix (key, "dir"))
             {
               g_hash_table_insert (amdirs, g_strdup (key), g_strdup (parts [1]));
-              continue;
+              if (line != NULL) /* Don't skip the following code on last iteration of loop */
+                continue;
             }
 
           names = g_strsplit (parts [1], " ", 0);


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