From: Timo Sirainen Date: Fri, 24 Apr 2015 10:08:16 +0000 (+0300) Subject: lib-fs: Use the new t_str_replace() instead of doing it ourself. X-Git-Tag: 2.2.17.rc1~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0593474ae2d8b1d4ec8c70c4fd84ea2bfede75a;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Use the new t_str_replace() instead of doing it ourself. --- diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index 8609adc6d0..69226f3e65 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -90,20 +90,7 @@ static void fs_class_deinit_modules(void) static const char *fs_driver_module_name(const char *driver) { - string_t *str; - unsigned int i; - - if (strchr(driver, '-') == NULL) - return driver; - - str = t_str_new(32); - for (i = 0; driver[i] != '\0'; i++) { - if (driver[i] == '-') - str_append_c(str, '_'); - else - str_append_c(str, driver[i]); - } - return str_c(str); + return t_str_replace(driver, '-', '_'); } static void fs_class_try_load_plugin(const char *driver)