[Devel] [PATCH 1/4] get_dist_name() gets shorter

Igor Podlesny openvz at poige.ru
Tue May 14 22:22:05 PDT 2013


---
 src/lib/dist.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/lib/dist.c b/src/lib/dist.c
index bde94ab..2b7fdf3 100644
--- a/src/lib/dist.c
+++ b/src/lib/dist.c
@@ -205,13 +205,7 @@ int read_dist_actions(char *dist_name, char *dir, dist_actions *actions)
  */
 char *get_dist_name(tmpl_param *tmpl)
 {
-	const char *p = NULL;
+	const char *p = tmpl->dist ? tmpl->dist : tmpl->ostmpl;
 
-	if (tmpl->dist != NULL)
-		p = tmpl->dist;
-	else if (tmpl->ostmpl != NULL)
-		p = tmpl->ostmpl;
-	if (p != NULL)
-		return strdup(p);
-	return NULL;
+	return p ? strdup(p) : NULL;
 }
-- 
1.7.9.5




More information about the Devel mailing list