[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/19] Make qemu_opts_parse() handle empty strings
From: |
Mark McLoughlin |
Subject: |
[Qemu-devel] [PATCH 05/19] Make qemu_opts_parse() handle empty strings |
Date: |
Thu, 10 Sep 2009 16:18:47 +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 4d544c7..d312257 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -711,8 +711,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)) {
@@ -749,7 +748,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 07/19] Never overwrite a QemuOpt, (continued)
- [Qemu-devel] [PATCH 08/19] Add qemu_net_opts, Mark McLoughlin, 2009/09/10
- [Qemu-devel] [PATCH 05/19] Make qemu_opts_parse() handle empty strings,
Mark McLoughlin <=
- [Qemu-devel] [PATCH 18/19] Port PCI NIC hotplug to QemuOpts, Mark McLoughlin, 2009/09/10
- [Qemu-devel] [PATCH 12/19] Port -net socket to QemuOpts, Mark McLoughlin, 2009/09/10
- [Qemu-devel] [PATCH 06/19] Add qemu_opts_validate() for post parsing validation, Mark McLoughlin, 2009/09/10
[Qemu-devel] [PATCH 10/19] Port -net user to QemuOpts, Mark McLoughlin, 2009/09/10
[Qemu-devel] [PATCH 09/19] Port -net none and -net nic to QemuOpts, Mark McLoughlin, 2009/09/10