diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-04-08 09:35:13 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-04-08 09:46:16 +0300 |
commit | a3c16055819f7236d0265dfa687f45031ee1b798 (patch) | |
tree | fd4321820641b2e28b955df9720924dedce765c4 /source/blender/blenlib | |
parent | 57468ae37ef98c7380edfbd97acb3bf6d626e4a7 (diff) |
Cleanup: rename to BLI_path_cwd to BLI_path_abs_from_cwd
This is now more clearly a function that makes the path absolute
using the current working directory.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_path_util.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 87f1ec5e4ff..9a6a14547d2 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -100,7 +100,7 @@ bool BLI_path_frame_range(char *path, int sta, int end, int digits) ATTR_NONNULL bool BLI_path_frame_get(char *path, int *r_frame, int *numdigits) ATTR_NONNULL(); void BLI_path_frame_strip(char *path, char *ext) ATTR_NONNULL(); bool BLI_path_frame_check_chars(const char *path) ATTR_NONNULL(); -bool BLI_path_cwd(char *path, const size_t maxlen) ATTR_NONNULL(); +bool BLI_path_abs_from_cwd(char *path, const size_t maxlen) ATTR_NONNULL(); void BLI_path_rel(char *file, const char *relfile) ATTR_NONNULL(); bool BLI_path_is_rel(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 95b2caa8836..2f51b66725b 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1116,13 +1116,14 @@ bool BLI_path_abs(char *path, const char *basepath) } /** - * Expands path relative to the current working directory, if it was relative. - * Returns true if such expansion was done. + * Checks for relative path, expanding them relative to the current working directory. + * Returns true if the expansion was performed. * - * \note Should only be done with command line paths. - * this is _not_ something blenders internal paths support like the "//" prefix + * \note Should only be called with command line paths. + * This is _not_ something Blender's internal paths support, instead they use the "//" prefix. + * In most cases #BLI_path_abs should be used instead. */ -bool BLI_path_cwd(char *path, const size_t maxlen) +bool BLI_path_abs_from_cwd(char *path, const size_t maxlen) { #ifdef DEBUG_STRSIZE memset(path, 0xff, sizeof(*path) * maxlen); |