Handle file names with quotes.

Let's repurpose escape_string and make it more flexible by letting us
choose the characters to escape.
This commit is contained in:
LemonBoy 2017-02-21 15:54:31 +01:00
commit 027acffb42
4 changed files with 20 additions and 14 deletions

View file

@ -88,8 +88,8 @@ char *stristr_full(const char *data, const char *key);
char *ascii_strup(char *str);
char *ascii_strdown(char *str);
/* Escape all '"', "'" and '\' chars with '\' */
char *escape_string(const char *str);
/* Escape all the characters in `what' with a backslash */
char *escape_string(const char *str, const char *what);
/* convert all low-ascii (<32) to ^<A..> combinations */
char *show_lowascii(const char *str);