diff --git a/lib/util.h b/lib/util.h index 0d4e9c012..f7e1f67f2 100644 --- a/lib/util.h +++ b/lib/util.h @@ -59,8 +59,6 @@ /* usage: str_cmp ("foo", !=, "bar") */ #define str_cmp(a,rel,b) (strcmp ((a), (b)) rel 0) -#define str_dup_range(s_start, s_bound) (g_strndup(s_start, s_bound - s_start)) - #define MC_PTR_FREE(ptr) do { g_free (ptr); (ptr) = NULL; } while (0) /*** enums ***************************************************************************************/ diff --git a/lib/vfs/mc-vfs/fish.c b/lib/vfs/mc-vfs/fish.c index 25ba59d4d..5f138038e 100644 --- a/lib/vfs/mc-vfs/fish.c +++ b/lib/vfs/mc-vfs/fish.c @@ -721,12 +721,12 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) --linkname_bound; /* skip trailing " */ } - ent->name = str_dup_range (filename, filename_bound); + ent->name = g_strndup (filename, filename_bound - filename); temp = ent->name; ent->name = strutils_shell_unescape (ent->name); g_free (temp); - ent->ino->linkname = str_dup_range (linkname, linkname_bound); + ent->ino->linkname = g_strndup (linkname, linkname_bound - linkname); temp = ent->ino->linkname; ent->ino->linkname = strutils_shell_unescape (ent->ino->linkname); g_free (temp); @@ -745,7 +745,7 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) if (*(filename_bound - 1) == '"') --filename_bound; } - ent->name = str_dup_range (filename, filename_bound); + ent->name = g_strndup (filename, filename_bound - filename); temp = ent->name; ent->name = strutils_shell_unescape (ent->name); g_free (temp);