diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-11-18 09:27:35 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-11-18 09:27:35 -0500 |
commit | a9d975389aaf5d79d738517b98161e375e757cba (patch) | |
tree | 634a4c1a4ddc9fe6b1a7748c980cbc48f58d624a /src/lib/core | |
parent | f2cc2cee71c6d2fb0cdd5b7736e86efa4f999c0a (diff) | |
download | stasis-a9d975389aaf5d79d738517b98161e375e757cba.tar.gz |
Break down indexer into independent source files
* Generate test result output
* Add helper function to manage changing file extensions
Diffstat (limited to 'src/lib/core')
-rw-r--r-- | src/lib/core/utils.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/core/utils.c b/src/lib/core/utils.c index 18731e6..c03f8fa 100644 --- a/src/lib/core/utils.c +++ b/src/lib/core/utils.c @@ -850,3 +850,13 @@ int env_manipulate_pathstr(const char *key, char *path, int mode) { return 0; } +int gen_file_extension_str(char *filename, const char *extension) { + char *ext_orig = strrchr(filename, '.'); + if (!ext_orig) { + strcat(filename, extension); + return 0; + } + + return replace_text(ext_orig, ext_orig, extension, 0); +} + |