summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/x1000-installer/src/xf_flashmap.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/x1000-installer/src/xf_flashmap.c b/lib/x1000-installer/src/xf_flashmap.c
index 2cde0f1c20..dc0a26a019 100644
--- a/lib/x1000-installer/src/xf_flashmap.c
+++ b/lib/x1000-installer/src/xf_flashmap.c
@@ -37,6 +37,18 @@ static int xdigit_to_int(char c)
37 return -1; 37 return -1;
38} 38}
39 39
40static int isfilenamechar(char c)
41{
42 return (c >= 'a' && c <= 'z') ||
43 (c >= 'A' && c <= 'Z') ||
44 (c >= '0' && c <= '9') ||
45 c == '$' || c == '%' || c == '\'' || c == '-' || c == '_' ||
46 c == '@' || c == '~' || c == '`' || c == '!' || c == '(' ||
47 c == ')' || c == '{' || c == '}' || c == '^' || c == '#' ||
48 c == '&' || c == '+' || c == ',' || c == ';' || c == '=' ||
49 c == '[' || c == ']' || c == '.';
50}
51
40int xf_map_parseline(const char* line, struct xf_map* map) 52int xf_map_parseline(const char* line, struct xf_map* map)
41{ 53{
42 enum { 54 enum {
@@ -66,7 +78,7 @@ int xf_map_parseline(const char* line, struct xf_map* map)
66 if(*line == ' ' || *line == '\t') { 78 if(*line == ' ' || *line == '\t') {
67 nextstate(); 79 nextstate();
68 continue; 80 continue;
69 } else if(isgraph((unsigned char)*line)) { 81 } else if(isfilenamechar(*line)) {
70 if(length == XF_MAP_NAMELEN) 82 if(length == XF_MAP_NAMELEN)
71 return XF_E_FILENAME_TOO_LONG; 83 return XF_E_FILENAME_TOO_LONG;
72 84