postgres.git / summary / log / commit / refs
commit 13553cbbff8670decab9cfed691bde7ed8a8b5b4
Author: Teodor Sigaev <teodor@sigaev.ru>
Date: Tue Sep 11 12:57:05 2007 +0000
First released in: 8.3.0, 8.0.14, 8.1.10, 8.2.5
Fix header's size of structs defines in ispell.
Backpatch is needed for contrib version.
src/backend/tsearch/spell.c | 4 ++--
src/include/tsearch/dicts/spell.h | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c
index 1b364b7a69b..aea20b33ee2 100644
--- a/src/backend/tsearch/spell.c
+++ b/src/backend/tsearch/spell.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.4 2007/09/10 20:27:12 teodor Exp $
+ * $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.5 2007/09/11 12:57:05 teodor Exp $
*
*-------------------------------------------------------------------------
*/
@@ -896,7 +896,7 @@ mkSPNode(IspellDict * Conf, int low, int high, int level)
if (!nchar)
return NULL;
- rs = (SPNode *) palloc0(SPNHRDSZ + nchar * sizeof(SPNodeData));
+ rs = (SPNode *) palloc0(SPNHDRSZ + nchar * sizeof(SPNodeData));
rs->length = nchar;
data = rs->data;
diff --git a/src/include/tsearch/dicts/spell.h b/src/include/tsearch/dicts/spell.h
index 3dc013fea1e..4f2d41e4f3e 100644
--- a/src/include/tsearch/dicts/spell.h
+++ b/src/include/tsearch/dicts/spell.h
@@ -6,7 +6,7 @@
*
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/tsearch/dicts/spell.h,v 1.2 2007/08/25 00:03:59 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/tsearch/dicts/spell.h,v 1.3 2007/09/11 12:57:05 teodor Exp $
*
*-------------------------------------------------------------------------
*/
@@ -52,7 +52,7 @@ typedef struct SPNode
SPNodeData data[1];
} SPNode;
-#define SPNHRDSZ (sizeof(uint32))
+#define SPNHDRSZ (offsetof(SPNode,data))
typedef struct spell_struct
@@ -123,7 +123,7 @@ typedef struct AffixNode
AffixNodeData data[1];
} AffixNode;
-#define ANHRDSZ (sizeof(uint32))
+#define ANHRDSZ (offsetof(AffixNode, data))
typedef struct
{
[parent: 64def0959253]