rename fc_format_path to fc_remove_redundant_slashes
parent
80b751980b
commit
7d5e94f9dd
|
|
@ -1136,7 +1136,8 @@ void chopPath(char *filePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int fc_format_path(const string_t *src, string_t *dest, const int size)
|
int fc_remove_redundant_slashes(const string_t *src,
|
||||||
|
string_t *dest, const int size)
|
||||||
{
|
{
|
||||||
#define MAX_SUBDIR_COUNT 128
|
#define MAX_SUBDIR_COUNT 128
|
||||||
const bool ignore_empty = true;
|
const bool ignore_empty = true;
|
||||||
|
|
|
||||||
|
|
@ -589,14 +589,35 @@ int get_time_item_from_str(const char *pValue, const char *item_name,
|
||||||
*/
|
*/
|
||||||
void chopPath(char *filePath);
|
void chopPath(char *filePath);
|
||||||
|
|
||||||
/** format the path
|
/** remove redundant slashes
|
||||||
* parameters:
|
* parameters:
|
||||||
* src: the input path
|
* src: the input path
|
||||||
* dest: the output path
|
* dest: the output path
|
||||||
* size: the max size of dest path
|
* size: the max size of dest path
|
||||||
* return: error no , 0 success, != 0 fail
|
* return: error no , 0 success, != 0 fail
|
||||||
*/
|
*/
|
||||||
int fc_format_path(const string_t *src, string_t *dest, const int size);
|
int fc_remove_redundant_slashes(const string_t *src,
|
||||||
|
string_t *dest, const int size);
|
||||||
|
|
||||||
|
static inline int fc_remove_redundant_slashes1(const char *input,
|
||||||
|
string_t *dest, const int size)
|
||||||
|
{
|
||||||
|
string_t src;
|
||||||
|
|
||||||
|
FC_SET_STRING(src, (char *)input);
|
||||||
|
return fc_remove_redundant_slashes(&src, dest, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int fc_remove_redundant_slashes2(const char *input,
|
||||||
|
char *output, const int size)
|
||||||
|
{
|
||||||
|
string_t src;
|
||||||
|
string_t dest;
|
||||||
|
|
||||||
|
FC_SET_STRING(src, (char *)input);
|
||||||
|
dest.str = output;
|
||||||
|
return fc_remove_redundant_slashes(&src, &dest, size);
|
||||||
|
}
|
||||||
|
|
||||||
/** get file content by fd
|
/** get file content by fd
|
||||||
* parameters:
|
* parameters:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue