diff options
author | Felix Fietkau <nbd@openwrt.org> | 2008-09-05 21:51:46 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2008-09-05 21:51:46 +0200 |
commit | 1a388b01f8c85a8a8b987789096d1f9e86b29fdf (patch) | |
tree | 7966b5ccba1ab61a600395b07a5a8685eb07b6a2 /util.c | |
parent | c0d8661d7ec87bd2cf06a496a0c4e50e61106747 (diff) | |
download | uci-1a388b01f8c85a8a8b987789096d1f9e86b29fdf.tar.gz |
overhaul package and section type validation - makes it easier to read and fixes some bugs in uci changes and uci show without explicit package references
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -96,6 +96,16 @@ __plugin bool uci_validate_str(const char *str, bool name) return true; } +static inline bool uci_validate_package(const char *str) +{ + return uci_validate_str(str, false); +} + +static inline bool uci_validate_type(const char *str) +{ + return uci_validate_str(str, false); +} + static inline bool uci_validate_name(const char *str) { return uci_validate_str(str, true); @@ -159,7 +169,7 @@ int uci_parse_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *str) goto error; lastval: - if (ptr->package && !uci_validate_str(ptr->package, false)) + if (ptr->package && !uci_validate_package(ptr->package)) goto error; if (ptr->section && !uci_validate_name(ptr->section)) ptr->flags |= UCI_LOOKUP_EXTENDED; |