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

Commitfc606df

Browse files
author
Marina Polyakova
committed
Merge remote-tracking branch 'origin/PGPRO-10866' into PGPRO-12044
2 parentsbd5eeb2 +a11142e commitfc606df

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

‎src/shared_ispell.c‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static SegmentInfo *segment_info = NULL;
8282
staticvoidispell_shmem_startup(void);
8383

8484
staticchar*shalloc(intbytes);
85-
staticchar*shstrcpy(char*str);
85+
staticchar*shstrcpy(constchar*str);
8686

8787
staticSharedIspellDict*copyIspellDict(IspellDict*dict,char*dictFile,char*affixFile,intbytes,intwords);
8888
staticSharedStopList*copyStopList(StopList*list,char*stopFile,intbytes);
@@ -348,13 +348,10 @@ init_shared_dict(DictInfo *info, MemoryContext infoCntx,
348348
dict->useFlagAliases= true;
349349
dict->lenAffixData=info->dict.lenAffixData;
350350
dict->nAffixData=info->dict.nAffixData;
351-
dict->AffixData= (char**)palloc0(dict->nAffixData*sizeof(char*));
351+
dict->AffixData= (constchar**)palloc0(dict->nAffixData*sizeof(char*));
352352

353353
for (i=0;i<dict->nAffixData;i++)
354-
{
355-
dict->AffixData[i]=palloc0(strlen(info->dict.AffixData[i])+1);
356-
strcpy(dict->AffixData[i],info->dict.AffixData[i]);
357-
}
354+
dict->AffixData[i]=pstrdup(info->dict.AffixData[i]);
358355
}
359356

360357
NISortDictionary(dict);
@@ -711,7 +708,7 @@ shalloc(int bytes)
711708
* by the code that reads and parses the dictionary / affixes).
712709
*/
713710
staticchar*
714-
shstrcpy(char*str)
711+
shstrcpy(constchar*str)
715712
{
716713
char*tmp=shalloc(strlen(str)+1);
717714

@@ -823,7 +820,7 @@ copyIspellDict(IspellDict *dict, char *dictFile, char *affixFile, int size, int
823820

824821
/* copy affix data */
825822
copy->dict.nAffixData=dict->nAffixData;
826-
copy->dict.AffixData= (char**)shalloc(sizeof(char*)*dict->nAffixData);
823+
copy->dict.AffixData= (constchar**)shalloc(sizeof(char*)*dict->nAffixData);
827824
for (i=0;i<copy->dict.nAffixData;i++)
828825
copy->dict.AffixData[i]=shstrcpy(dict->AffixData[i]);
829826

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp