dovecot-2.2: lib-fs: Use the new t_str_replace() instead of doin...

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 24 10:09:52 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/cf3c7bcbbdd9
changeset: 18469:cf3c7bcbbdd9
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Apr 24 13:08:16 2015 +0300
description:
lib-fs: Use the new t_str_replace() instead of doing it ourself.

diffstat:

 src/lib-fs/fs-api.c |  15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)

diffs (25 lines):

diff -r 90298bc1a481 -r cf3c7bcbbdd9 src/lib-fs/fs-api.c
--- a/src/lib-fs/fs-api.c	Fri Apr 24 13:07:39 2015 +0300
+++ b/src/lib-fs/fs-api.c	Fri Apr 24 13:08:16 2015 +0300
@@ -90,20 +90,7 @@
 
 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)


More information about the dovecot-cvs mailing list