From 4321cffc8717bbe3171776a8fe027fd09f6d6dd7 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Wed, 27 Jan 2010 18:31:13 +0100 Subject: [PATCH] Make queries on daap.songalbumid:0 a no-op Remote makes queries with daap.songalbumid:0, which doesn't make sense. Make that a no-op. --- src/DAAP2SQL.g | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/DAAP2SQL.g b/src/DAAP2SQL.g index c8757b2a..7ffb91a3 100644 --- a/src/DAAP2SQL.g +++ b/src/DAAP2SQL.g @@ -107,6 +107,15 @@ expr returns [ pANTLR3_STRING result, int valid ] /* NOTE: the lexer delivers the string without quotes which may not be obvious from the grammar due to embedded code */ + + /* Make daap.songalbumid:0 a no-op */ + if (strcmp((char *)str->chars, "daap.songalbumid:0") == 0) + { + $result->append8($result, "1 = 1"); + + goto STR_out; + } + field = str->chars; val = field; @@ -304,5 +313,8 @@ expr returns [ pANTLR3_STRING result, int valid ] if (escaped) free(escaped); + + STR_out: /* get out of here */ + ; } ;