summaryrefslogtreecommitdiffstats
path: root/contrib/restricted/aws/aws-c-common/source/file.c
diff options
context:
space:
mode:
authorshadchin <[email protected]>2024-12-03 17:05:42 +0300
committershadchin <[email protected]>2024-12-03 18:21:15 +0300
commit6388569551ef4720bdcd3f07af43fedbecabc847 (patch)
tree279445f9bbee9b4f7b518fde918e49b4c00566c0 /contrib/restricted/aws/aws-c-common/source/file.c
parent528eb8de83d25bf28f3d4a1202155523477ad4ac (diff)
Update contrib/restricted/aws/aws-c-common to 0.8.23
commit_hash:ee9e58d849fe0a4add15cf37c9a8899e88291b18
Diffstat (limited to 'contrib/restricted/aws/aws-c-common/source/file.c')
-rw-r--r--contrib/restricted/aws/aws-c-common/source/file.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/restricted/aws/aws-c-common/source/file.c b/contrib/restricted/aws/aws-c-common/source/file.c
index 5f490003a03..01eb0a6afde 100644
--- a/contrib/restricted/aws/aws-c-common/source/file.c
+++ b/contrib/restricted/aws/aws-c-common/source/file.c
@@ -87,6 +87,19 @@ bool aws_is_any_directory_separator(char value) {
return value == '\\' || value == '/';
}
+void aws_normalize_directory_separator(struct aws_byte_buf *path) {
+ AWS_PRECONDITION(aws_byte_buf_is_valid(path));
+
+ const char local_platform_separator = aws_get_platform_directory_separator();
+ for (size_t i = 0; i < path->len; ++i) {
+ if (aws_is_any_directory_separator((char)path->buffer[i])) {
+ path->buffer[i] = local_platform_separator;
+ }
+ }
+
+ AWS_POSTCONDITION(aws_byte_buf_is_valid(path));
+}
+
struct aws_directory_iterator {
struct aws_linked_list list_data;
struct aws_allocator *allocator;