diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index 71cfb1759..4a35e9847 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -592,15 +592,24 @@ e_util_filename_escape(const char *filename) while (*p) { if ((q - buf) > 4090) return NULL; - if ( + if (*p == '\'') + { + *q= '\''; + q++; + *q = '\\'; + q++; + *q= '\''; + q++; + } + else if ( (*p == ' ') || (*p == '\t') || (*p == '\n') || - (*p == '\\') || (*p == '\'') || (*p == '\"') || + (*p == '\\') || (*p == '\"') || (*p == '\?') || (*p == ';') || (*p == '!') || (*p == '#') || (*p == '$') || (*p == '%') || (*p == '&') || (*p == '*') || (*p == '(') || (*p == ')') || (*p == '[') || (*p == ']') || (*p == '{') || (*p == '}') || (*p == '|') || (*p == '<') || - (*p == '>') || (*p == '?') + (*p == '>') ) { *q = '\\';