提交 f51f5fe2 编写于 作者: B Benjamin Sago

Also escape characters in broken symlinks

上级 395f9021
......@@ -176,9 +176,12 @@ Vagrant.configure(2) do |config|
echo -ne "#{test_dir}/file-names/new-line-dir: [\\n]" | xargs -0 mkdir
echo -ne "#{test_dir}/file-names/new-line-dir: [\\n]/subfile" | xargs -0 touch
echo -ne "#{test_dir}/file-names/new-line-dir: [\\n]/another: [\\n]" | xargs -0 touch
echo -ne "#{test_dir}/file-names/new-line-dir: [\\n]/broken" | xargs -0 touch
mkdir "#{test_dir}/file-names/links"
ln -s "#{test_dir}/file-names/new-line-dir"*/* "#{test_dir}/file-names/links"
echo -ne "#{test_dir}/file-names/new-line-dir: [\\n]/broken" | xargs -0 rm
EOF
......
......@@ -59,7 +59,7 @@ impl<'a, 'dir> FileName<'a, 'dir> {
bits.push(Style::default().paint(" "));
bits.push(self.colours.broken_arrow.paint("->"));
bits.push(Style::default().paint(" "));
bits.push(self.colours.broken_filename.paint(broken_path.display().to_string()));
escape(broken_path.display().to_string(), &mut bits, self.colours.broken_filename, self.colours.control_char.underline());
},
FileTarget::Err(_) => {
......
......@@ -6,7 +6,7 @@ emoji: [🆒] invalid-utf8-4: [�(�(] utf-8: pâté
escape: [\u{1b}] links vertical-tab: [\u{b}]
/testcases/file-names/links:
another: [\n] subfile
another: [\n] broken subfile
/testcases/file-names/new-line-dir: [\n]:
another: [\n] subfile
......@@ -16,6 +16,8 @@
│ └── <Error: path somehow contained a NUL?>
├── links
│ ├── another: [\n] -> /testcases/file-names/new-line-dir: [\n]/another: [\n]
│ ├── broken -> /testcases/file-names/new-line-dir: [\n]/broken
│ │ └── <No such file or directory (os error 2)>
│ └── subfile -> /testcases/file-names/new-line-dir: [\n]/subfile
├── new-line-dir: [\n]
│ ├── another: [\n]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册