Author: grehan Date: Mon Jul 1 23:53:22 2013 New Revision: 252494 URL: http://svnweb.freebsd.org/changeset/base/252494
Log: Fix up option parsing to allow a colon in the config section. Clean up some other unnecessary code. Submitted by: Dinakar Medavaram dinnu sun at gmail Reviewed by: neel Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Mon Jul 1 23:12:59 2013 (r252493) +++ head/usr.sbin/bhyve/pci_emul.c Mon Jul 1 23:53:22 2013 (r252494) @@ -140,20 +140,15 @@ pci_parse_slot(char *opt, int legacy) error = -1; str = cpy = strdup(opt); - config = NULL; - - if (strchr(str, ':') != NULL) { - slot = strsep(&str, ":"); - func = strsep(&str, ","); - } else { - slot = strsep(&str, ","); - func = NULL; - } - + slot = strsep(&str, ","); + func = NULL; + if (strchr(slot, ':') != NULL) { + func = cpy; + (void) strsep(&func, ":"); + } + emul = strsep(&str, ","); - if (str != NULL) { - config = strsep(&str, ","); - } + config = str; if (emul == NULL) { pci_parse_slot_usage(opt); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"