From e169fa4a85e03b2b03bb1bdba716b96654ae6050 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 14 Apr 2016 16:01:56 +0200 Subject: fix Alt-Filename handling of file method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A silly of-by-one error in the stripping of the extension to check for the uncompressed filename broken in an attempt to support all compressions in commit a09f6eb8fc67cd2d836019f448f18580396185e5. Fixing this highlights also mistakes in the handling of the Alt-Filename in libapt which would cause apt to remove the file from the repository (if root has the needed rights – aka the disk isn't readonly or similar) --- methods/file.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/file.cc b/methods/file.cc index 4e3410078..36f3c39b9 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -98,7 +98,7 @@ bool FileMethod::Fetch(FetchItem *Itm) { if (APT::String::Endswith(File, *ext) == true) { - std::string const unfile = File.substr(0, File.length() - ext->length() - 1); + std::string const unfile = File.substr(0, File.length() - ext->length()); if (stat(unfile.c_str(),&Buf) == 0) { AltRes.Size = Buf.st_size; -- cgit v1.2.3