Skip to content
Snippets Groups Projects
Commit f872c735 authored by swym's avatar swym
Browse files

Merge branch 'blacklist_fix' into 'master'

fix(pycardium): make it work with absolute paths

See merge request !223
parents cb046114 1f91d731
No related branches found
No related tags found
1 merge request!223fix(pycardium): make it work with absolute paths
Pipeline #3168 passed
......@@ -10,12 +10,20 @@
#include "os.h"
bool pycrd_filename_restricted(const char *fname)
bool pycrd_filename_restricted(const char *path)
{
// files that cannot be opened in write modes
const char *const forbidden_files[] = {
"card10.bin", "menu.py", "main.py", "card10.cfg"
};
const char *fname = strchr(path, '/');
while (fname) {
path = fname + 1;
fname = strchr(path, '/');
}
fname = path;
for (int i = 0;
i < sizeof(forbidden_files) / sizeof(forbidden_files[0]);
i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment