]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Use the new t_str_replace() instead of doing it ourself.
authorTimo Sirainen <tss@iki.fi>
Fri, 24 Apr 2015 10:08:16 +0000 (13:08 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 24 Apr 2015 10:08:16 +0000 (13:08 +0300)
src/lib-fs/fs-api.c

index 8609adc6d0ac60633b4bb0c55988f3b7412fb295..69226f3e653d0c6c2e94fb805f8c0e93d7056059 100644 (file)
@@ -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)