Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6de3fe3

Browse files
committed
Avoid conflict strndup with glibc
1 parent461b71f commit6de3fe3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎contrib/tsearch2/ispell/spell.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ strlower(char *str)
4141
}
4242

4343
staticchar*
44-
strndup(char*s,intlen) {
44+
strnduplicate(char*s,intlen) {
4545
char*d=(char*)palloc(len+1 );
4646
memcpy(d,s,len );
4747
d[len]='\0';
@@ -866,7 +866,7 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word,
866866
/* and its length more than minimal */
867867
if (wordlen==level+1 ) {
868868
/* well, it was last word */
869-
var->stem[var->nstem ]=strndup(word+startpos,wordlen-startpos);
869+
var->stem[var->nstem ]=strnduplicate(word+startpos,wordlen-startpos);
870870
var->nstem++;
871871
returnvar;
872872
}else {
@@ -877,7 +877,7 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word,
877877
ptr->next=SplitToVariants(Conf,node,var,word,wordlen,startpos,level);
878878
/* we can find next word */
879879
level++;
880-
var->stem[var->nstem ]=strndup(word+startpos,level-startpos);
880+
var->stem[var->nstem ]=strnduplicate(word+startpos,level-startpos);
881881
var->nstem++;
882882
node=Conf->Dictionary;
883883
startpos=level;
@@ -889,7 +889,7 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word,
889889
node=StopMiddle->node;
890890
}
891891

892-
var->stem[var->nstem ]=strndup(word+startpos,wordlen-startpos);
892+
var->stem[var->nstem ]=strnduplicate(word+startpos,wordlen-startpos);
893893
var->nstem++;
894894
returnvar;
895895
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp