diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-07-19 18:05:13 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-07-19 18:05:13 +0200 |
commit | bbd8308cc01941e51e2cbcf88168a5560abe6042 (patch) | |
tree | 1f82c7a91ed12c584bc7fa8f91e31397d37d69d5 /apt-pkg/contrib/fileutl.h | |
parent | 87f99f6fa701d2557811134380c1f232cf07a422 (diff) |
ensure Cnf::FindFile doesn't return files below /dev/null
Very unlikely, but if the parent is /dev/null, the child empty and the
grandchild a value we returned /dev/null/value which doesn't exist, so
hardly a problem, but for best operability we should be consistent in
our work and return /dev/null always.
Diffstat (limited to 'apt-pkg/contrib/fileutl.h')
-rw-r--r-- | apt-pkg/contrib/fileutl.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index f33f7804b..c13613171 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -234,6 +234,8 @@ std::string flCombine(std::string Dir,std::string File); /** \brief Takes a file path and returns the absolute path */ std::string flAbsPath(std::string File); +/** \brief removes superfluous /./ and // from path */ +APT_HIDDEN std::string flNormalize(std::string file); // simple c++ glob std::vector<std::string> Glob(std::string const &pattern, int flags=0); |