mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
(vfs_translate_path): return const char *.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
ae824a3622
commit
034e973fbf
@ -336,17 +336,13 @@ vfs_strip_suffix_from_filename (const char *filename)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
char *
|
||||
const char *
|
||||
vfs_translate_path (const char *path)
|
||||
{
|
||||
estr_t state;
|
||||
|
||||
g_string_set_size (vfs_str_buffer, 0);
|
||||
state = _vfs_translate_path (path, -1, str_cnv_from_term, vfs_str_buffer);
|
||||
/*
|
||||
strict version
|
||||
return (state == 0) ? vfs_str_buffer->data : NULL;
|
||||
*/
|
||||
return (state != ESTR_FAILURE) ? vfs_str_buffer->str : NULL;
|
||||
}
|
||||
|
||||
@ -355,7 +351,7 @@ vfs_translate_path (const char *path)
|
||||
char *
|
||||
vfs_translate_path_n (const char *path)
|
||||
{
|
||||
char *result;
|
||||
const char *result;
|
||||
|
||||
result = vfs_translate_path (path);
|
||||
return (result != NULL) ? g_strdup (result) : NULL;
|
||||
|
@ -247,7 +247,7 @@ vfs_class_flags_t vfs_file_class_flags (const vfs_path_t * vpath);
|
||||
/* translate path back to terminal encoding, remove all #enc:
|
||||
* every invalid character is replaced with question mark
|
||||
* return static buffer */
|
||||
char *vfs_translate_path (const char *path);
|
||||
const char *vfs_translate_path (const char *path);
|
||||
/* return new string */
|
||||
char *vfs_translate_path_n (const char *path);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user