diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-09-01 23:26:35 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2016-09-01 23:26:35 +0300 |
commit | 8546868b68642c2c9199825b5043c435b80dc90e (patch) | |
tree | cb6839c63caab69fedf91501eab55b7ada54a696 /bpkg | |
parent | 6b0eda1aa74cb306a477e25dfee3a2693151a396 (diff) |
Do not strip absolute location canonical name prefix if the result is empty
Diffstat (limited to 'bpkg')
-rw-r--r-- | bpkg/manifest.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bpkg/manifest.cxx b/bpkg/manifest.cxx index 86ca7fa..d6c6afb 100644 --- a/bpkg/manifest.cxx +++ b/bpkg/manifest.cxx @@ -1682,6 +1682,13 @@ namespace bpkg dir_path sp (strip_path ( path_, remote () ? strip_mode::component : strip_mode::path)); + // If for an absolute path location the stripping result is empty (which + // also means <path> part is empty as well) then fallback to stripping + // just the version component. + // + if (absolute () && sp.empty ()) + sp = strip_path (path_, strip_mode::version); + string cp (sp.relative () ? sp.posix_string () : sp.string ()); // Note: allow empty paths (e.g., http://stable.cppget.org/1/). |