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 to the shell, for example, you should first quote it with this function.

The return value must be freed with g_free().

The quoting style used is undefined (single or double quotes may be used).

Parameters

unquoted_string

Type: const gchar*

A literal string.

The data is owned by the caller of the function.
The value is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.

Return value

Type: gchar*

Quoted string.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.