return dep->post;
}
+/*
+ * Replace dashes with underscores.
+ * Dashes inside character range patterns (e.g. [0-9]) are left unchanged.
+ */
+static char *underscores(struct kmod_ctx *ctx, char *s)
+{
+ unsigned int i;
+
+ if (!s)
+ return NULL;
+
+ for (i = 0; s[i]; i++) {
+ switch (s[i]) {
+ case '-':
+ s[i] = '_';
+ break;
+
+ case ']':
+ INFO(ctx, "Unmatched bracket in %s\n", s);
+ break;
+
+ case '[':
+ i += strcspn(&s[i], "]");
+ if (!s[i])
+ INFO(ctx, "Unmatched bracket in %s\n", s);
+ break;
+ }
+ }
+ return s;
+}
+
static int kmod_config_add_command(struct kmod_config *config,
const char *modname,
const char *command,
}
}
-/*
- * Replace dashes with underscores.
- * Dashes inside character range patterns (e.g. [0-9]) are left unchanged.
- */
-char *underscores(struct kmod_ctx *ctx, char *s)
-{
- unsigned int i;
-
- if (!s)
- return NULL;
-
- for (i = 0; s[i]; i++) {
- switch (s[i]) {
- case '-':
- s[i] = '_';
- break;
-
- case ']':
- INFO(ctx, "Unmatched bracket in %s\n", s);
- break;
-
- case '[':
- i += strcspn(&s[i], "]");
- if (!s[i])
- INFO(ctx, "Unmatched bracket in %s\n", s);
- break;
- }
- }
- return s;
-}
-
inline int alias_normalize(const char *alias, char buf[PATH_MAX], size_t *len)
{
size_t s;
char *getline_wrapped(FILE *fp, unsigned int *linenum) __attribute__((nonnull(1)));
-char *underscores(struct kmod_ctx *ctx, char *s) __attribute__((nonnull(1, 2)));
#define streq(a, b) (strcmp((a), (b)) == 0)
#define strstartswith(a, b) (strncmp(a, b, strlen(b)) == 0)
void *memdup(const void *p, size_t n) __attribute__((nonnull(1)));