[gthumb] webalbums: do not exit if a fatal error is issued



commit 67da6e05b807adf4334e677420f20256b30aa7f4
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Feb 15 10:55:18 2015 +0100

    webalbums: do not exit if a fatal error is issued
    
    [bug #744530]

 extensions/webalbums/albumtheme.l |    9 ++++++---
 extensions/webalbums/albumtheme.y |    7 +++++++
 2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/extensions/webalbums/albumtheme.l b/extensions/webalbums/albumtheme.l
index 448f972..189c797 100644
--- a/extensions/webalbums/albumtheme.l
+++ b/extensions/webalbums/albumtheme.l
@@ -30,6 +30,9 @@ GFileInputStream *yy_istream;
        result = (n <= 0 ? YY_NULL : n);                                                                \
 }
 
+#undef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) gth_albumtheme_yyfatalerror(msg)
+
 static int before_string = 0; /* the start condition before entering in STRING */
 
 %}
@@ -75,7 +78,7 @@ string           [^']*
                                        return PRINT;
                                }
 <FUNCTION>{attribute_name}     {
-                                       if (g_str_equal (yytext, "eval") || g_str_equal (yytext, 
"translate")) 
+                                       if (g_str_equal (yytext, "eval") || g_str_equal (yytext, "translate"))
                                                BEGIN (CONDITION);
                                        else
                                                BEGIN (ATTRIBUTES);
@@ -175,7 +178,7 @@ string           [^']*
                                }
 <QUOTE,CONDITION>".."          {
                                        return RANGE;
-                               }                               
+                               }
 <QUOTE,CONDITION>"in"          {
                                        return IN;
                                }
@@ -186,7 +189,7 @@ string           [^']*
 <QUOTE,CONDITION>{name}                {
                                        yylval.text = g_strdup (yytext);
                                        return VARIABLE;
-                               }               
+                               }
 <ATTRIBUTES,QUOTE,CONDITION>[ \t\n]    {
                                        /* Eat spaces inside tag. */
                                }
diff --git a/extensions/webalbums/albumtheme.y b/extensions/webalbums/albumtheme.y
index 63ba87d..86f71e1 100644
--- a/extensions/webalbums/albumtheme.y
+++ b/extensions/webalbums/albumtheme.y
@@ -26,6 +26,7 @@
 
 int   gth_albumtheme_yylex   (void);
 void  gth_albumtheme_yyerror (const char *fmt, ...);
+void  gth_albumtheme_yyfatalerror (const char *msg);
 int   gth_albumtheme_yywrap  (void);
 
 #define YY_NO_UNPUT
@@ -461,4 +462,10 @@ gth_albumtheme_yyerror (const char *fmt, ...)
 }
 
 
+void
+gth_albumtheme_yyfatalerror (const char *msg)
+{
+       g_error ("%s", msg);
+}
+
 #include "albumtheme-lex.c"


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