realpath: empty operand aborts with a garbled error instead of being reported as missing

未关闭 适合新手
#16,206 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@emirmrkaljevic 已经在做这个了。

开始于 2026年11月5日。

  • #16207 来自 @emirmrkaljevic —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
cli

调研方向

从 realpath 的参数解析和操作数处理入手,然后将其行为与本 issue 中关于空操作数以及空的 --relative-to 或 --relative-base 值的示例进行比较。检查现有的 realpath 测试,并为这些情况补充覆盖;完成标准是空值被报告为缺失文件,同时其他操作数仍能解析,退出状态为 1。

由索引模型根据 Issue 内容生成。

描述

U - realpath

realpath rejects an empty operand while parsing arguments, so it prints a garbled clap error and skips every other operand. GNU treats '' like any missing file: it reports it and still resolves the rest.

$ realpath '' /usr; echo "exit $?"
error: error: invalid value for one of the arguments

exit 1

GNU coreutils 9.12:

$ realpath '' /usr; echo "exit $?"
realpath: '': No such file or directory
/usr
exit 1

The same garbled message shows up for --relative-to='' and --relative-base='', where GNU prints realpath: '': No such file or directory.

Found with behave, comparing uutils realpath (main) against a spec recorded from GNU realpath 9.12.

主要语言
Rust
星标
24.3k
派生
2.2k
平均合并
2 天 17 小时
30 天内合并 PR
422

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

uutils/coreutils 的其他 Issue

查看 uutils/coreutils 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。