# HG changeset patch # User Mike Becker # Date 1602666471 -7200 # Node ID 8f6ad495f53840141ca59acc64bb0290eb5769a2 # Parent de3b2bb46492a5daf3a0f6e02a6519221d83c5cb adds more characters to escape for shell completion diff -r de3b2bb46492 -r 8f6ad495f538 dav/main.c --- a/dav/main.c Sat Jul 25 13:15:04 2020 +0200 +++ b/dav/main.c Wed Oct 14 11:07:51 2020 +0200 @@ -3372,12 +3372,13 @@ if(space) { size_t l = strlen(elm->path); for(int i=0;ipath[i] == ' ' && quote == '\0') { - ucx_buffer_puts(out, "\\ "); - } else { - ucx_buffer_putc(out, elm->path[i]); + // only if we do not quote, we have to escape + char nextc = elm->path[i]; + if(quote == '\0' && NULL != strchr( + "!\"#$&'()*,;<>?[\\]^`{|}~ ", nextc)) { + ucx_buffer_putc(out, '\\'); } + ucx_buffer_putc(out, nextc); } } else { ucx_buffer_puts(out, elm->path);