[llvm] r291340 - TarWriter: Use Ustar header's "prefix" field to store long filenames.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 13:02:25 PST 2017


On Mon, Jan 9, 2017 at 12:58 PM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> > +// Returns true if a given path can be stored to a Ustar header
> > +// without the PAX extension.
> > +static bool fitInUstar(StringRef Path) {
> > +  StringRef Prefix;
> > +  StringRef Name;
> > +  std::tie(Prefix, Name) = splitPath(Path);
> > +  return Name.size() <= sizeof(UstarHeader::Name);
>
> Don't you have to check sizeof(UstarHeader::Prefix) too?
>

No, I don't, because that's guaranteed to be satisfied. If a path is too
long, only Name part can exceed its maximum length.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170109/5ad54064/attachment.html>


More information about the llvm-commits mailing list