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
Pipeline #3168 passed with stages
in 1 minute and 21 seconds
......@@ -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++) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment