[recipes] Don't error out on unknown units



commit 437bd59b2de50d75399467687bc7149c16abd895
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 17 22:02:15 2017 -0500

    Don't error out on unknown units
    
    We won't be able to convert them, but we should just keep them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777517

 src/gr-ingredients-list.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/gr-ingredients-list.c b/src/gr-ingredients-list.c
index e634517..b837511 100644
--- a/src/gr-ingredients-list.c
+++ b/src/gr-ingredients-list.c
@@ -101,9 +101,8 @@ gr_ingredients_list_populate (GrIngredientsList  *ingredients,
                 u = "";
                 if (unit[0] != '\0' &&
                     ((u = gr_unit_parse (&unit, &local_error)) == NULL)) {
-                        g_message ("failed to parse unit in '%s': %s", unit, local_error->message);
-                        g_free (ing);
-                        continue;
+                        g_message ("%s; using %s as-is", local_error->message, unit);
+                        u = unit;
                 }
 
                 ing->unit = g_strdup (u);


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