Bläddra i källkod

[settings] Treat an empty formatted value as meaning "delete setting"

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 år sedan
förälder
incheckning
5ad445fd0b
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2
    2
      src/core/settings.c

+ 2
- 2
src/core/settings.c Visa fil

@@ -1052,8 +1052,8 @@ int storef_setting ( struct settings *settings, struct setting *setting,
1052 1052
 	int check_len;
1053 1053
 	int rc;
1054 1054
 
1055
-	/* NULL value implies deletion */
1056
-	if ( ! value )
1055
+	/* NULL value or empty string implies deletion */
1056
+	if ( ( ! value ) || ( ! value[0] ) )
1057 1057
 		return delete_setting ( settings, setting );
1058 1058
 
1059 1059
 	/* Parse formatted value */

Laddar…
Avbryt
Spara