[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Make qemu_opts_parse() handle empty strings
From: |
Mark McLoughlin |
Subject: |
[Qemu-devel] [PATCH] Make qemu_opts_parse() handle empty strings |
Date: |
Tue, 6 Oct 2009 12:17:02 +0100 |
Rather than making callers explicitly handle empty strings by using
qemu_opts_create(), we can easily have qemu_opts_parse() handle
empty parameter strings.
Signed-off-by: Mark McLoughlin <address@hidden>
---
qemu-option.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/qemu-option.c b/qemu-option.c
index 293f94c..735259f 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -712,8 +712,7 @@ int qemu_opts_do_parse(QemuOpts *opts, const char *params,
const char *firstname
char option[128], value[128];
const char *p,*pe,*pc;
- p = params;
- for(;;) {
+ for (p = params; *p != '\0'; p++) {
pe = strchr(p, '=');
pc = strchr(p, ',');
if (!pe || (pc && pc < pe)) {
@@ -750,7 +749,6 @@ int qemu_opts_do_parse(QemuOpts *opts, const char *params,
const char *firstname
if (*p != ',') {
break;
}
- p++;
}
return 0;
}
--
1.6.2.5
- [Qemu-devel] [PATCH 00/19 v3] Port -net to QemuOpts, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Don't assign a static string to NICInfo::model, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Make NICInfo string fields non-const, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Register rtc options for -set, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Use qemu_strdup() for NICInfo string fields, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Use qemu_strdup() for VLANClientState string fields, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Make qemu_opts_parse() handle empty strings,
Mark McLoughlin <=
- [Qemu-devel] [PATCH] Move memset() from net_client_uninit() to net_client_init(), Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Don't exit() in config_error(), Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Add qemu_opts_validate() for post parsing validation, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Make net_client_init() consume slirp_configs even on error, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Remove bogus error message from qemu_opts_set(), Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Remove double error message in qemu_option_set(), Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Drop config_error(), use qemu_error() instead, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Final net cleanup after conversion to QemuOpts, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Remove double error message for -device option parsing, Mark McLoughlin, 2009/10/06
- [Qemu-devel] [PATCH] Never overwrite a QemuOpt, Mark McLoughlin, 2009/10/06