libical (0.48-2) fix_arm_ftbfs.patch

Summary

 src/libicalss/icalsslexer.c |    4 +++-
 src/libicalss/icalsslexer.l |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

    
download this patch

Patch contents

From: Robie Basak <robie.basak@canonical.com>
Subject: Fix libicalss parser for non-Intel architectures

The test suite fails on ARM and PowerPC because the libicalss lexer
performs unput(EOF) which is not permitted. On these architectures, this
gets interpreted as unput(255), creating an extra token which then
causes the parser to return a syntax error.

Instead, the lexer should just ignore EOF and not attempt to unput it.
The input stream will remain at EOF and the lexer will return an EOF as
the next token as needed.

Forwarded: https://sourceforge.net/tracker/?func=detail&aid=3517199&group_id=16077&atid=316077
Bug-Ubuntu: https://bugs.launchpad.net/bugs/979846
Last-Update: 2012-04-12

---
 src/libicalss/icalsslexer.c |    4 +++-
 src/libicalss/icalsslexer.l |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

--- a/src/libicalss/icalsslexer.c
+++ b/src/libicalss/icalsslexer.c
@@ -936,7 +936,9 @@ case 20:
 YY_RULE_SETUP
 {
 	int c = input();
-	unput(c);
+	if (c != EOF) {
+		unput(c);
+	}
 	if(c!='\''){
 		sslval.v_string= icalmemory_tmp_copy(sstext);
 		return STRING;
--- a/src/libicalss/icalsslexer.l
+++ b/src/libicalss/icalsslexer.l
@@ -111,7 +111,9 @@ NULL			{ return SQLNULL; }
 
 \'[\@\*A-Za-z0-9\-\.\:\ ]+\' {
 	int c = input();
-	unput(c);
+	if (c != EOF) {
+		unput(c);
+	}
 	if(c!='\''){
 		sslval.v_string= icalmemory_tmp_copy(yytext);
 		return STRING;