Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix problem in chsrc_get_cpuarch() and chsrc_prepend_to_file() #42

Merged
merged 2 commits into from
Jul 6, 2024
Merged

fix problem in chsrc_get_cpuarch() and chsrc_prepend_to_file() #42

merged 2 commits into from
Jul 6, 2024

Conversation

Gn3po4g
Copy link
Contributor

@Gn3po4g Gn3po4g commented Jul 6, 2024

在函数chsrc_get_cpuarch()中,查看cpu命令应该是uname -m?

ret = xy_run ("uname -p", 0, NULL);

chsrc_prepend_to_file()函数似乎忘记了添加空格导致sed命令缺少文件参数,
应为xy_strjoin (4, "sed -i '1i ", str, "' ", file);

cmd = xy_strjoin (4, "sed -i '1i ", str, "'", file);

@ccmywish
Copy link
Contributor

ccmywish commented Jul 6, 2024

@Gn3po4g 感谢指出sed调用的错误。


uname -p 在你的系统中有问题吗?因为 -p 指的是 processor-m 指的是 machine,尽管 -p 在 man 手册中被标注为 non-portable,但是我觉得它更符合该函数的含义。如果 -p 确实存在问题,我将直接合并你这边的代码。

@Gn3po4g
Copy link
Contributor Author

Gn3po4g commented Jul 6, 2024

可能是因为我使用的是wsl?uname -p输出结果为unknown

@ccmywish
Copy link
Contributor

ccmywish commented Jul 6, 2024

WSL的哪个系统?

另外,你把 chsrc.h 最上面的 Contributors : Null Nil <null@nil.com> 改成你自己的信息

@Gn3po4g
Copy link
Contributor Author

Gn3po4g commented Jul 6, 2024

yuk7的Arch Linux WSL2发行版。uname完整信息如下:
Linux GPC 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 GNU/Linux

@ccmywish ccmywish changed the base branch from main to dev July 6, 2024 15:19
@ccmywish ccmywish merged commit c319fa8 into RubyMetric:dev Jul 6, 2024
@ccmywish
Copy link
Contributor

ccmywish commented Jul 6, 2024

@Gn3po4g

了解了,感谢你的贡献!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants