When quoting backslash, the code was not advancing the source, so the destination was getting repeated backslashes until the buffer was full.
@@ -118,6 +118,7 @@ path_quote_filename(char *dst, const char *src, size_t n)
case '\\':
*dst++ = '\\';
+ src++;
size -= 2;
break;
default: