任务单 #45034

strcasecmp() used instead of fc_strcasecmp()

开放日期: 2022-07-06 15:40 最后更新: 2022-08-05 09:01

报告人:
属主:
(无)
类型:
状态:
开启
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
文件:
1

Details

grep -r "strcasecmp" . | grep -v "fc_strcasecmp"

任务单历史 (3/8 Histories)

2022-07-06 15:40 Updated by: cazfi
  • New Ticket "strcasecmp() used instead of fc_strcasecmp()" created
2022-07-19 14:12 Updated by: cazfi
2022-07-20 09:06 Updated by: dark-ether
评论

i am not familiar with this specific function, what are the differences to the normal strcasecmp? if the arguments are in the same order i probably could craft a sed command to change all offending files

2022-07-20 16:03 Updated by: cazfi
评论

Reply To dark-ether

what are the differences to the normal strcasecmp?

Most fc_...() replacements have originally been introduced for being more portable (often just wrappers for the "real" function of the platform), or more secure (hardened).

This specific one has since been converted to use icu -> it's utf8 aware.

2022-07-21 05:28 Updated by: dark-ether
评论

Reply To cazfi

Reply To dark-ether

what are the differences to the normal strcasecmp?

Most fc_...() replacements have originally been introduced for being more portable (often just wrappers for the "real" function of the platform), or more secure (hardened). This specific one has since been converted to use icu -> it's utf8 aware.

i looked at how fc_strcasecmp and strcasecmp were called and they appeared to be equal so i just used ripgrep and sed to find and modify the uses.

2022-07-21 06:47 Updated by: cazfi
评论

I think we would want to change the cvercmp ones too despite it having an upstream separate from freeciv - the way it's part of freeciv build process, linked in statically, and uses it with freeciv provided strings, assumes such compatibility.

Can you also provide patch for all branches where this is expected (S3_0, S3_1, master)? If you have branches set up as separate git worktrees it should be quite trivial.

2022-08-05 09:01 Updated by: cazfi

编辑

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » 登录名