Uci doesn't support files with '.' in the config name and also have
parsing problems confusing option section with the actual filename.
Example:
hello.apk-new is parsed as hello filename and apk-new section
To correctly handle and prevent any kind of error, skip parsing these
file entirely. This is now needed for APK support as it does generate
config with a .apk-new suffix if a config already exist and the package
is updated.
Signed-off-by: Christian Marangi <[email protected]>
* after the last '/' character. By checking for a non-'\0'
* character afterwards, directories are ignored (glob marks
* those with a trailing '/'
+ * Filename with '.' are ignored and not parsed. Uci doesn't
+ * permit config files with '.' in the name and cause parsing
+ * problems.
*/
static inline char *get_filename(char *path)
{
p++;
if (!*p)
return NULL;
+
+ if (strrchr(p, '.'))
+ return NULL;
+
return p;
}