summaryrefslogtreecommitdiff
path: root/methods/file.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-04-14 16:01:56 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-04-14 16:15:39 +0200
commite169fa4a85e03b2b03bb1bdba716b96654ae6050 (patch)
tree5f7ceadd6f2b10091d4731577c4b444e9805e3b0 /methods/file.cc
parentc75e60ebb6bc7a578b57e7c4e01579798bae720b (diff)
fix Alt-Filename handling of file method
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)
Diffstat (limited to 'methods/file.cc')
-rw-r--r--methods/file.cc2
1 files changed, 1 insertions, 1 deletions
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;