[babl] babl.db: if git hash has changed, drop cache



commit b3730a3429972561c3eb7a68607b32b47da0e62c
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Nov 14 20:47:39 2016 +0100

    babl.db: if git hash has changed, drop cache

 babl/babl.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/babl/babl.c b/babl/babl.c
index 3199777..22c104c 100644
--- a/babl/babl.c
+++ b/babl/babl.c
@@ -296,6 +296,12 @@ static void babl_init_db (const char *path)
           babl=NULL;
           break;
         case '#':
+          /* if babl has changed in git .. drop whole cache */
+          if (strcmp ( &token[1], BABL_GIT_VERSION))
+          {
+            free (contents);
+            return;
+          }
           break;
         case '\t':
           if (strchr (token, '='))


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