#include <inttypes.h>
#include <string.h>
#include <sys/types.h>
+#include <ctype.h>
/* default strtoxx_or_err() exit code */
#ifndef STRTOXX_EXIT_CODE
return (char *)s + sl - pl;
}
+/*
+ * Skip leading white space.
+ */
+static inline const char *skip_space(const char *p)
+{
+ while (isspace(*p))
+ ++p;
+ return p;
+}
+
+static inline const char *skip_blank(const char *p)
+{
+ while (isblank(*p))
+ ++p;
+ return p;
+}
+
#endif
#include "pathnames.h"
#include "strutils.h"
-static inline char *skip_spaces(char *s)
-{
- assert(s);
-
- while (*s == ' ' || *s == '\t')
- s++;
- return s;
-}
-
static int next_number(char **s, int *num)
{
char *end = NULL;
assert(num);
assert(s);
- *s = skip_spaces(*s);
+ *s = (char *) skip_blank(*s);
if (!**s)
return -1;
*num = strtol(*s, &end, 10);
fs->passno = fs->freq = 0;
if (xrc == 4 && n)
- s = skip_spaces(s + n);
+ s = (char *) skip_blank(s + n);
if (xrc == 4 && *s) {
if (next_number(&s, &fs->freq) != 0) {
if (*s) {
static int is_comment_line(char *line)
{
- char *p = skip_spaces(line);
+ char *p = (char *) skip_blank(line);
if (p && (*p == '#' || *p == '\n'))
return 1;
*s = '\0';
if (--s >= buf && *s == '\r')
*s = '\0';
- s = skip_spaces(buf);
+ s = (char *) skip_blank(buf);
} while (*s == '\0' || *s == '#');
if (tb->fmt == MNT_FMT_GUESS) {