Function
GLibshell_quote
Declaration [src]
gchar*
g_shell_quote (
const gchar* unquoted_string
)
Description [src]
Quotes a string so that the shell (/bin/sh) will interpret the
quoted string to mean unquoted_string.
If you pass a filename or other untrusted input to g_shell_parse_argv(),
you should first quote it with this function. This is sufficient to ensure
untrusted input cannot ‘break out’ of the quotes. Beware: this only works
because g_shell_parse_argv() is not a real Unix shell. Quoting untrusted
input is not an adequate security mechanism when using a real shell.
The return value must be freed with g_free().
The quoting style used is undefined (single or double quotes may be used).