/*---------------------------------------------------------------------------*/
/*
* Copyright (C) 2011-2014 Red Hat, Inc.
- * Copyright 2010, diateam (www.diateam.net)
+ * Copyright (C) 2010-2014, diateam (www.diateam.net)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
return -1;
}
- if ((tmp = STRSKIP(verbuf, pattern)) == NULL) {
+ if ((tmp = strstr(verbuf, pattern)) == NULL) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot find version pattern \"%s\""), pattern);
+ return -1;
+ }
+
+ if ((tmp = STRSKIP(tmp, pattern)) == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to parse %sversion"), pattern);
return -1;
} while (0)
DO_TEST("ws", "workstation-7.0.0", 7000000);
+ DO_TEST("ws", "workstation-7.0.0-with-garbage", 7000000);
DO_TEST("fusion", "fusion-5.0.3", 5000003);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;