Skip to content

cf_path_normalize

Category: path
GitHub: cute_string.h


Normalizes a path as a new string.

#define cf_path_normalize(path) spnorm(path)
Parameters Description
path The path string.

Return Value

Returns a new dynamic string. Free with sfree.

Remarks

Shortform: spnorm(path). All '\' are replaced with '/'. Duplicate '////' become single '/'. Trailing '/' removed. Dot folders resolved. The first character is always '/', unless a windows drive (e.g. "C:/Users/Randy/Documents").

cf_path_get_filename
cf_path_directory_of
cf_path_pop