diff options
author | Pino Toscano <[email protected]> | 2018-12-25 16:44:19 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-12-30 11:38:27 +0100 |
commit | 82108808f13d056b3904c1717658a306a4aba2dd (patch) | |
tree | b9280444bbef3c1c14ef2e7ce2d96edc3afbb337 /libmenu/entry-directories.c | |
parent | 96505c413183f8569fbb45c5d39cfcb7a95598cd (diff) | |
download | mate-menus-82108808f13d056b3904c1717658a306a4aba2dd.tar.bz2 mate-menus-82108808f13d056b3904c1717658a306a4aba2dd.tar.xz |
Switch to modern realpath()
Assume everywhere that the realpath() implementation has the
POSIX.1-2008 behaviour, i.e. allowing NULL as second parameter and thus
returning a newly allocated buffer; it is not just a GNU extension,
and supported already by modern libc's on other OSes.
menu_canonicalize_file_name() is always called with FALSE as second
parameter, so it is replaced directly by realpath(); this allows the
complete removal of canonicalize.{c,h}.
This is a forward-port of the same changes done in gnome-menus, see:
https://gitlab.gnome.org/GNOME/gnome-menus/merge_requests/4
Diffstat (limited to 'libmenu/entry-directories.c')
-rw-r--r-- | libmenu/entry-directories.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libmenu/entry-directories.c b/libmenu/entry-directories.c index 2a21807..33b68eb 100644 --- a/libmenu/entry-directories.c +++ b/libmenu/entry-directories.c @@ -25,10 +25,10 @@ #include <errno.h> #include <sys/types.h> #include <dirent.h> +#include <stdlib.h> #include "menu-util.h" #include "menu-monitor.h" -#include "canonicalize.h" typedef struct CachedDir CachedDir; typedef struct CachedDirMonitor CachedDirMonitor; @@ -731,7 +731,7 @@ static EntryDirectory* entry_directory_new_full(DesktopEntryType entry_type, con path, is_legacy ? "<yes>" : "<no>"); - canonical = menu_canonicalize_file_name (path, FALSE); + canonical = realpath (path, NULL); if (canonical == NULL) { menu_verbose ("Failed to canonicalize \"%s\": %s\n", |