From: Ray Strode Date: Tue, 9 Aug 2016 14:39:15 +0000 (-0400) Subject: basic: drop unnecessary strempty() call in replace_env X-Git-Tag: v233~59^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8ad241f54b8c4ac76aafd960d89b47b0ed87fb6;p=thirdparty%2Fsystemd.git basic: drop unnecessary strempty() call in replace_env strempty() converts a NULL value to empty string, so that it can be passed on to functions that don't support NULL. replace_env calls strempty before passing its value on to strappend. strappend supports NULL just fine, though, so this commit drops the strempty call. --- diff --git a/src/basic/env-util.c b/src/basic/env-util.c index f9208d1475a..86ac07e1b69 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -563,7 +563,7 @@ char *replace_env(const char *format, char **env) { if (*e == '}') { const char *t; - t = strempty(strv_env_get_n(env, word+2, e-word-2)); + t = strv_env_get_n(env, word+2, e-word-2); k = strappend(r, t); if (!k)