diff options
| author | Teodor Sigaev | 2003-12-04 12:21:11 +0000 |
|---|---|---|
| committer | Teodor Sigaev | 2003-12-04 12:21:11 +0000 |
| commit | 6de3fe3c0d51161dc0ea92de9868ca5fe5d77629 (patch) | |
| tree | 91e8900107f0c2d2ec23f3e22695c79f5b83e723 | |
| parent | 461b71f20842b63f3e86620a108cd28f0dbad371 (diff) | |
Avoid conflict strndup with glibc
| -rw-r--r-- | contrib/tsearch2/ispell/spell.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/tsearch2/ispell/spell.c b/contrib/tsearch2/ispell/spell.c index aa5848b5c1b..1c2624fe863 100644 --- a/contrib/tsearch2/ispell/spell.c +++ b/contrib/tsearch2/ispell/spell.c @@ -41,7 +41,7 @@ strlower(char *str) } static char* -strndup(char *s, int len) { +strnduplicate(char *s, int len) { char *d=(char*)palloc( len + 1 ); memcpy(d, s, len ); d[len]='\0'; @@ -866,7 +866,7 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word, /* and its length more than minimal */ if ( wordlen==level+1 ) { /* well, it was last word */ - var->stem[ var->nstem ] = strndup(word + startpos, wordlen - startpos); + var->stem[ var->nstem ] = strnduplicate(word + startpos, wordlen - startpos); var->nstem++; return var; } else { @@ -877,7 +877,7 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word, ptr->next=SplitToVariants(Conf, node, var, word, wordlen, startpos, level); /* we can find next word */ level++; - var->stem[ var->nstem ] = strndup(word + startpos, level - startpos); + var->stem[ var->nstem ] = strnduplicate(word + startpos, level - startpos); var->nstem++; node = Conf->Dictionary; startpos=level; @@ -889,7 +889,7 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word, node=StopMiddle->node; } - var->stem[ var->nstem ] = strndup(word + startpos, wordlen - startpos); + var->stem[ var->nstem ] = strnduplicate(word + startpos, wordlen - startpos); var->nstem++; return var; } |
