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

chop last null byte #127

Open
2 tasks
lilydjwg opened this issue Jul 15, 2017 · 4 comments
Open
2 tasks

chop last null byte #127

lilydjwg opened this issue Jul 15, 2017 · 4 comments

Comments

@lilydjwg
Copy link
Owner

  • Haskell2: chop without check
  • FreePascal: chop without check
@biluohc
Copy link

biluohc commented Dec 27, 2017

rust也没有这个 lastnull。
所以是不是把没有lastnull的语言的chopnull去掉,否则相对c/cpp语言是不公平的?

@lilydjwg
Copy link
Owner Author

这里是指 cmdline 里最后可能的 null 字节,不是编程语言的字符串实现里可能有的那个。

正常的 cmdline 文件里,参数都是以 null 结尾的(而不是以 null 分割的),所以不删掉直接转成空格的话最后就有一个空格,不好看。但是有些程序不知道干了什么,最后并没有 null 字符,这个时候就不应该把最后一个字节丢掉了。

@biluohc
Copy link

biluohc commented Dec 28, 2017

我明白了, 就是c/cpp之类不需要chopnull,而那些字符串里可以有\0的就要chopnull了是吧?

@lilydjwg
Copy link
Owner Author

都需要的。

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

No branches or pull requests

2 participants