Skip to content

Commit

Permalink
better documentation of the return value in the normalize function #45
Browse files Browse the repository at this point in the history
  • Loading branch information
likle committed Feb 7, 2024
1 parent 982e860 commit f418404
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/reference/cwk_path_normalize.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Creates a normalized version of the path.
size_t cwk_path_normalize(const char *path, char *buffer, size_t buffer_size);
```
This function creates a normalized version of the path within the specified buffer. This function will not write out more than the specified buffer can contain. However, the generated string is always null-terminated - even if not the whole path is written out. The function returns the total number of characters the complete buffer would have, even if it was not written out completely. The path may be the same memory address as the buffer.
This function creates a normalized version of the path within the specified buffer. This function will not write out more than the specified buffer can contain. However, the generated string is always null-terminated - even if not the whole path is written out. The returned value is the amount of characters which the resulting path would take if it was not truncated (excluding the null-terminating character). The path may be the same memory address as the buffer.
The following will be true for the normalized path:
* "../" will be resolved.
Expand Down
7 changes: 4 additions & 3 deletions include/cwalk.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,10 @@ CWK_PUBLIC size_t cwk_path_change_extension(const char *path,
* This function creates a normalized version of the path within the specified
* buffer. This function will not write out more than the specified buffer can
* contain. However, the generated string is always null-terminated - even if
* not the whole path is written out. The function returns the total number of
* characters the complete buffer would have, even if it was not written out
* completely. The path may be the same memory address as the buffer.
* not the whole path is written out. The returned value is the amount of
* characters which the resulting path would take if it was not truncated
* (excluding the null-terminating character). The path may be the same memory
* address as the buffer.
*
* The following will be true for the normalized path:
* 1) "../" will be resolved.
Expand Down

0 comments on commit f418404

Please sign in to comment.