Ticket #1453 (crash mc on create new file in external editor (S-F4))

fix: crash mc when path is null on create new file in external editor
This commit is contained in:
Ilia Maslakov 2009-08-03 15:37:55 +00:00
parent 1affb29969
commit 3b1070fb3d
1 changed files with 5 additions and 2 deletions

View File

@ -496,7 +496,7 @@ char *
vfs_translate_path_n (const char *path)
{
char *result;
result = vfs_translate_path (path);
return (result != NULL) ? g_strdup (result) : NULL;
}
@ -506,7 +506,10 @@ vfs_canon_and_translate (const char *path)
{
char *canon;
char *result;
canon = vfs_canon (path);
if (path == NULL)
canon = g_strdup ("");
else
canon = vfs_canon (path);
result = vfs_translate_path_n (canon);
g_free (canon);
return result;