[llvm-ar] Remove leading slash when printing thin archive members
Reviewers: ruiu Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57845 llvm-svn: 353347
This commit is contained in:
parent
351314a14f
commit
db5036504e
|
@ -0,0 +1,10 @@
|
||||||
|
RUN: mkdir -p %t/foo
|
||||||
|
RUN: touch %t/foo/a.txt
|
||||||
|
RUN: rm -f %t/foo/archive.a
|
||||||
|
|
||||||
|
RUN: cd %t && llvm-ar rcST foo/archive.a foo/a.txt
|
||||||
|
RUN: cd %t && llvm-ar t foo/archive.a | FileCheck %s --match-full-lines --check-prefix=PARENT-DIR
|
||||||
|
RUN: cd %t/foo && llvm-ar t archive.a | FileCheck %s --match-full-lines --check-prefix=CHILD-DIR
|
||||||
|
|
||||||
|
PARENT-DIR: foo/a.txt
|
||||||
|
CHILD-DIR: a.txt
|
|
@ -429,8 +429,9 @@ static void doDisplayTable(StringRef Name, const object::Archive::Child &C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (C.getParent()->isThin()) {
|
if (C.getParent()->isThin()) {
|
||||||
outs() << sys::path::parent_path(ArchiveName);
|
StringRef ParentDir = sys::path::parent_path(ArchiveName);
|
||||||
outs() << '/';
|
if (!ParentDir.empty())
|
||||||
|
outs() << ParentDir << '/';
|
||||||
}
|
}
|
||||||
outs() << Name << "\n";
|
outs() << Name << "\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue