From 5737c21d791ca310f85f108c3dda47ec5c681677 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Tue, 22 May 2007 20:02:28 +0000 Subject: [PATCH] a NULL parameter doesn't remove the parameter, an empty string remove it --- libemile/emile_second_set_param.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/libemile/emile_second_set_param.c b/libemile/emile_second_set_param.c index 7d86716..b46b65a 100644 --- a/libemile/emile_second_set_param.c +++ b/libemile/emile_second_set_param.c @@ -23,19 +23,28 @@ int emile_second_set_param(int fd, char *kernel, char *parameters, char *initrd) return -1; if (kernel != NULL) - emile_second_set_property(configuration, "kernel", kernel); - else - emile_second_remove_property(configuration, "kernel"); + { + if (*kernel) + emile_second_set_property(configuration, "kernel", kernel); + else + emile_second_remove_property(configuration, "kernel"); + } if (parameters != NULL) - emile_second_set_property(configuration, "parameters", parameters); - else - emile_second_remove_property(configuration, "parameters"); + { + if (*parameters) + emile_second_set_property(configuration, "parameters", parameters); + else + emile_second_remove_property(configuration, "parameters"); + } if (initrd != NULL) - emile_second_set_property(configuration, "initrd", initrd); - else - emile_second_remove_property(configuration, "initrd"); + { + if (*initrd) + emile_second_set_property(configuration, "initrd", initrd); + else + emile_second_remove_property(configuration, "initrd"); + } emile_second_set_property(configuration, "vga", "default");