* @str: pointer to the char pointer used
*
* Skip potential blanks, this includes space tabs, line feed,
- * carriage returns and also '\\' which can be erronously emitted
- * by xend
+ * carriage returns.
*/
void
virSkipSpaces(const char **str)
{
const char *cur = *str;
- while ((*cur == ' ') || (*cur == '\t') || (*cur == '\n') ||
- (*cur == '\r') || (*cur == '\\'))
+ while (c_isspace(*cur))
+ cur++;
+ *str = cur;
+}
+
+/**
+ * virSkipSpacesAndBackslash:
+ * @str: pointer to the char pointer used
+ *
+ * Like virSkipSpaces, but also skip backslashes erroneously emitted
+ * by xend
+ */
+void
+virSkipSpacesAndBackslash(const char **str)
+{
+ const char *cur = *str;
+
+ while (c_isspace(*cur) || *cur == '\\')
cur++;
*str = cur;
}
int virMacAddrCompare (const char *mac1, const char *mac2);
void virSkipSpaces(const char **str);
+void virSkipSpacesAndBackslash(const char **str);
int virParseNumber(const char **str);
int virParseVersionString(const char *str, unsigned long *version,
bool allowMissing);
cell = virParseNumber(&cur);
if (cell < 0)
goto parse_error;
- virSkipSpaces(&cur);
+ virSkipSpacesAndBackslash(&cur);
if (*cur != ':')
goto parse_error;
cur++;
- virSkipSpaces(&cur);
+ virSkipSpacesAndBackslash(&cur);
if (STRPREFIX(cur, "no cpus")) {
nb_cpus = 0;
for (cpu = 0; cpu < numCpus; cpu++)