Commit Graph

5 Commits

Author SHA1 Message Date
nulltoken
2e6fd09c5d Fixed naming convention related issue. 2011-01-29 03:29:33 +02:00
nulltoken
618818dcb7 Added git_prettify_file_path(). 2011-01-29 03:29:32 +02:00
nulltoken
ae7ffea961 Fixed a parsing issue in git_prettify_dir_path(). 2011-01-29 03:29:32 +02:00
nulltoken
e16c2f6a4c Small enhancements to git_prettify_dir_path().
- Secured buffer ahead reading.
 - Guard against potential multiple dot path traversal (cf http://cwe.mitre.org/data/definitions/33.html)
2011-01-20 13:03:49 -08:00
nulltoken
170d3f2fbb Added git_prettify_dir_path().
Clean up a provided absolute or relative directory path.

This prettification relies on basic operations such as coalescing multiple forward slashes into a single slash, removing '.' and './' current directory segments, and removing parent directory whenever '..' is encountered. If not empty, the returned path ends with a forward slash.

For instance, this will turn "d1/s1///s2/..//../s3" into "d1/s3/".

This only performs a string based analysis of the path. No checks are done to make sure the path actually makes sense from the file system perspective.
2011-01-11 20:12:53 +01:00