From 2f1eacfcad489fcc36a1c7d80bc76315de7167a7 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Mon, 2 Mar 2009 02:34:24 -0800 Subject: [PATCH] msi: Don't treat carriage returns as spaces. --- dlls/msi/tests/db.c | 36 ++++++++---------------------------- dlls/msi/tokenize.c | 4 ++-- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index e5ada2bb3b7..e1e9fb747e4 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -5344,11 +5344,8 @@ static void test_carriagereturn(void) query = "CREATE TABLE `Table`\r ( `A` CHAR(72) NOT NULL PRIMARY KEY `A` )"; r = run_query(hdb, 0, query); - todo_wine - { - ok(r == ERROR_BAD_QUERY_SYNTAX, - "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); - } + ok(r == ERROR_BAD_QUERY_SYNTAX, + "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); query = "CREATE TABLE `Table` \r( `A` CHAR(72) NOT NULL PRIMARY KEY `A` )"; r = run_query(hdb, 0, query); @@ -5449,11 +5446,8 @@ static void test_carriagereturn(void) query = "CREATE TABLE `Four` ( `A` CHAR(72\r) NOT NULL PRIMARY KEY `A` )"; r = run_query(hdb, 0, query); - todo_wine - { - ok(r == ERROR_BAD_QUERY_SYNTAX, - "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); - } + ok(r == ERROR_BAD_QUERY_SYNTAX, + "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); query = "CREATE TABLE `Four` ( `A` CHAR(\r72) NOT NULL PRIMARY KEY `A` )"; r = run_query(hdb, 0, query); @@ -5487,10 +5481,7 @@ static void test_carriagereturn(void) size = MAX_PATH; r = MsiRecordGetStringA(hrec, 1, buf, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(buf, "\rOne"), "Expected \"\\rOne\", got \"%s\"\n", buf); - } + ok(!lstrcmpA(buf, "\rOne"), "Expected \"\\rOne\", got \"%s\"\n", buf); MsiCloseHandle(hrec); @@ -5500,10 +5491,7 @@ static void test_carriagereturn(void) size = MAX_PATH; r = MsiRecordGetStringA(hrec, 1, buf, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(buf, "Tw\ro"), "Expected \"Tw\\ro\", got \"%s\"\n", buf); - } + ok(!lstrcmpA(buf, "Tw\ro"), "Expected \"Tw\\ro\", got \"%s\"\n", buf); MsiCloseHandle(hrec); @@ -5513,20 +5501,12 @@ static void test_carriagereturn(void) size = MAX_PATH; r = MsiRecordGetStringA(hrec, 1, buf, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(buf, "Three\r"), - "Expected \"Three\r\", got \"%s\"\n", buf); - } + ok(!lstrcmpA(buf, "Three\r"), "Expected \"Three\r\", got \"%s\"\n", buf); MsiCloseHandle(hrec); r = MsiViewFetch(hview, &hrec); - todo_wine - { - ok(r == ERROR_NO_MORE_ITEMS, - "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); - } + ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); MsiViewClose(hview); MsiCloseHandle(hview); diff --git a/dlls/msi/tokenize.c b/dlls/msi/tokenize.c index b92e2a0ca95..04824562de4 100644 --- a/dlls/msi/tokenize.c +++ b/dlls/msi/tokenize.c @@ -193,8 +193,8 @@ static const char isIdChar[] = { int sqliteGetToken(const WCHAR *z, int *tokenType){ int i; switch( *z ){ - case ' ': case '\t': case '\n': case '\f': case '\r': { - for(i=1; isspace(z[i]); i++){} + case ' ': case '\t': case '\n': case '\f': { + for(i=1; isspace(z[i]) && z[i] != '\r'; i++){} *tokenType = TK_SPACE; return i; }