Introduce xbps_sanitize_path() to fix #78 properly.

This removes multiple slashes of a path and returns you a buffer with
the sanitized string.
This commit is contained in:
Juan RP
2015-02-18 15:12:39 +01:00
parent 3c34c300d1
commit 1722635e08
3 changed files with 54 additions and 10 deletions

View File

@@ -48,7 +48,7 @@
*
* This header documents the full API for the XBPS Library.
*/
#define XBPS_API_VERSION "20150203"
#define XBPS_API_VERSION "20150218"
#ifndef XBPS_VERSION
#define XBPS_VERSION "UNSET"
@@ -1933,6 +1933,15 @@ int xbps_cmpver(const char *pkg1, const char *pkg2);
*/
char *xbps_pubkey2fp(struct xbps_handle *xhp, xbps_data_t pubkey);
/**
* Returns a buffer with a sanitized path from \a src.
* This removes multiple slashes.
*
* @return The sanitized path in a buffer.
* The returned buffer must be free(3)d when it's no longer necessary.
*/
char *xbps_sanitize_path(const char *src);
/*@}*/
#ifdef __cplusplus