mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 09:19:24 +03:00
src/strescape.{c,h}: sanitized fn proto to keep in sync with rest of code
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
This commit is contained in:
parent
16811ed607
commit
3a7de274e0
@ -46,7 +46,7 @@ static const char ESCAPE_GLOB_CHARS[] = "$*\\";
|
|||||||
/*** public functions ****************************************************************************/
|
/*** public functions ****************************************************************************/
|
||||||
|
|
||||||
char *
|
char *
|
||||||
strutils_escape (const char *src, int src_len, const char *escaped_chars,
|
strutils_escape (const char *src, gsize src_len, const char *escaped_chars,
|
||||||
gboolean escape_non_printable)
|
gboolean escape_non_printable)
|
||||||
{
|
{
|
||||||
GString *ret;
|
GString *ret;
|
||||||
@ -60,7 +60,7 @@ strutils_escape (const char *src, int src_len, const char *escaped_chars,
|
|||||||
|
|
||||||
ret = g_string_new ("");
|
ret = g_string_new ("");
|
||||||
|
|
||||||
if (src_len == -1)
|
if (src_len == (gsize)-1)
|
||||||
src_len = strlen (src);
|
src_len = strlen (src);
|
||||||
|
|
||||||
for (curr_index = 0; curr_index < src_len; curr_index++) {
|
for (curr_index = 0; curr_index < src_len; curr_index++) {
|
||||||
@ -96,7 +96,7 @@ strutils_escape (const char *src, int src_len, const char *escaped_chars,
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
char *
|
char *
|
||||||
strutils_unescape (const char *src, int src_len, const char *unescaped_chars,
|
strutils_unescape (const char *src, gsize src_len, const char *unescaped_chars,
|
||||||
gboolean unescape_non_printable)
|
gboolean unescape_non_printable)
|
||||||
{
|
{
|
||||||
GString *ret;
|
GString *ret;
|
||||||
@ -110,7 +110,7 @@ strutils_unescape (const char *src, int src_len, const char *unescaped_chars,
|
|||||||
|
|
||||||
ret = g_string_new ("");
|
ret = g_string_new ("");
|
||||||
|
|
||||||
if (src_len == -1)
|
if (src_len == (gsize)-1)
|
||||||
src_len = strlen (src);
|
src_len = strlen (src);
|
||||||
|
|
||||||
for (curr_index = 0; curr_index < src_len-1; curr_index++) {
|
for (curr_index = 0; curr_index < src_len-1; curr_index++) {
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
/*** declarations of public functions ************************************************************/
|
/*** declarations of public functions ************************************************************/
|
||||||
|
|
||||||
char *strutils_escape (const char *, int, const char *, gboolean);
|
char *strutils_escape (const char *, gsize, const char *, gboolean);
|
||||||
char *strutils_unescape (const char *, int, const char *, gboolean);
|
char *strutils_unescape (const char *, gsize, const char *, gboolean);
|
||||||
|
|
||||||
char *strutils_shell_unescape (const char *);
|
char *strutils_shell_unescape (const char *);
|
||||||
char *strutils_shell_escape (const char *);
|
char *strutils_shell_escape (const char *);
|
||||||
|
Loading…
Reference in New Issue
Block a user