diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -331,6 +331,15 @@ util_expand_home(char *buffer, const char *filename, size_t length) { strncpy(buffer, filename, length); return buffer; } +char * +util_normalize_filename(char *buffer, const char *filename, size_t length) { + char *tmp = buffer; + for (int i=0; *filename != 0 && i<length-1; i++, filename++, buffer++) { + *buffer = *filename == '/' ? '_' : *filename; + } + *buffer = 0; + return tmp; +} /* util_set_file_content(const char *filename, const char *content) {{{*/ gboolean util_set_file_content(const char *filename, const char *content) { |