summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/hashes.cc2
-rw-r--r--apt-pkg/contrib/hashes.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc
index da714f997..fcc2f887c 100644
--- a/apt-pkg/contrib/hashes.cc
+++ b/apt-pkg/contrib/hashes.cc
@@ -44,7 +44,7 @@ HashString::HashString(string StringedHash)
return;
}
string::size_type pos = StringedHash.find(":");
- Type = StringedHash.substr(0,pos-1);
+ Type = StringedHash.substr(0,pos);
Hash = StringedHash.substr(pos+1, StringedHash.size() - pos);
if(_config->FindB("Debug::Hashes",false) == true)
diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h
index 86c0eb2ad..93e7b25d9 100644
--- a/apt-pkg/contrib/hashes.h
+++ b/apt-pkg/contrib/hashes.h
@@ -38,6 +38,9 @@ class HashString
HashString(string StringedHashString); // init from str as "type:hash"
HashString();
+ // get hash type used
+ string HashType() { return Type; };
+
// verify the given filename against the currently loaded hash
bool VerifyFile(string filename) const;